internal ListLinked(ListLinked <T> listLinked) { Node head = new Node(listLinked._head.Value); Node current = listLinked._head.Next; Node current_clone = head; while (!(current is null)) { current_clone.Next = new Node(current.Value); current_clone = current_clone.Next; current = current.Next; } _head = head; _tail = current_clone; _count = listLinked._count; }
internal ListLinked(ListLinked <T> list) { if (list._head is not null) { _head = new Node(value: list._head.Value); Node?a = list._head.Next; Node?b = _head; while (a is not null) { b.Next = new Node(value: a.Value); b = b.Next; a = a.Next; } _tail = b; _count = list._count; } }
/// <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 ListLinked <T>(); }
/// <summary>Constructs a Order_ListArray.</summary> /// <param name="compare">The soring technique used by this data structure.</param> public OrderListLinked(Func <T, T, CompareResult> compare) { this._compare = compare; this._list = new ListLinked <T>(); }