Example #1
0
        /// <summary>Creates a shallow clone of this data structure.</summary>
        /// <returns>A shallow clone of this data structure.</returns>
        public AddableLinked <T> Clone()
        {
            Node head          = new Node(this._head.Value);
            Node current       = this._head.Next;
            Node current_clone = head;

            while (current != null)
            {
                current_clone.Next = new Node(current.Value);
                current_clone      = current_clone.Next;
                current            = current.Next;
            }
            AddableLinked <T> clone = new AddableLinked <T>();

            clone._head  = head;
            clone._tail  = current_clone;
            clone._count = this._count;
            return(clone);
        }
Example #2
0
 /// <summary>Constructs a Order_ListArray.</summary>
 /// <param name="compare">The soring technique used by this data structure.</param>
 public OrderListLinked(Compare <T> compare)
 {
     this._compare = compare;
     this._list    = new AddableLinked <T>();
 }