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;
        }
Exemple #2
0
 public MyTempQueue()
 {
     _items = new MyLinkedList <T>();
 }
Exemple #3
0
 public MyTempStack()
 {
     _itemList = new MyLinkedList <T>();
 }