public static void ReverseList(MyLinkedList <T> list)
        {
            var current = list.Head;
            MyLinkedNode <T> prev = null, next = null;

            while (current.Next != null)
            {
                next = current.Next;

                current.Next = prev;
                prev         = current;

                current = next;
            }

            current.Next = prev;
            list.Head    = current;
        }
Esempio n. 2
0
 public MyTempQueue()
 {
     _items = new MyLinkedList <T>();
 }
Esempio n. 3
0
 public MyTempStack()
 {
     _itemList = new MyLinkedList <T>();
 }