public void AddLast(MLinkedList <T> mLinkedList) { mLinkedList.First.Previous = Last; Last.Next = mLinkedList.First; Last = mLinkedList.Last; Count += mLinkedList.Count; }
public void AddFirst(T item) { if (First == null) { First = new MLinkedListNode <T>(item); Last = First; } else { First.Previous = new MLinkedListNode <T>(item) { Next = First }; First = First.Previous; } Count += 1; }
public void AddLast(T item) { if (Last == null) { Last = new MLinkedListNode <T>(item); First = Last; } else { Last.Next = new MLinkedListNode <T>(item) { Previous = Last }; Last = Last.Next; } Count += 1; }
public MLinkedList() { First = null; Last = null; Count = 0; }
public void Clear() { First = null; Last = null; Count = 0; }
public void Reset() { CurrentNode = null; }
public bool MoveNext() { CurrentNode = (CurrentNode == null) ? _linkedList?.First : CurrentNode.Next; return(CurrentNode != null); }