예제 #1
0
        public void AddLast(MLinkedList <T> mLinkedList)
        {
            mLinkedList.First.Previous = Last;
            Last.Next = mLinkedList.First;
            Last      = mLinkedList.Last;

            Count += mLinkedList.Count;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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;
        }
예제 #4
0
 public MLinkedList()
 {
     First = null;
     Last  = null;
     Count = 0;
 }
예제 #5
0
 public void Clear()
 {
     First = null;
     Last  = null;
     Count = 0;
 }
예제 #6
0
 public void Reset()
 {
     CurrentNode = null;
 }
예제 #7
0
 public bool MoveNext()
 {
     CurrentNode = (CurrentNode == null) ? _linkedList?.First : CurrentNode.Next;
     return(CurrentNode != null);
 }