Exemple #1
0
        static void Main(string[] args)
        {
            MyLinkedList ll = new MyLinkedList();

            /*["MyLinkedList","addAtHead","Get","addAtHead","addAtHead","deleteAtIndex","addAtHead","Get","Get","Get","addAtHead","deleteAtIndex"]
             * [[],[4],[1],[1],[5],[3],[7],[3],[3],[3],[1],[4]]
             */
            ll.AddAtHead(1);
            Console.Write(RemoveElements(ll.Head));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            MyLinkedList myLinkedList = new MyLinkedList();

            myLinkedList.AddAtHead(2);
            myLinkedList.DeleteAtIndex(1);
            myLinkedList.AddAtHead(2);
            myLinkedList.AddAtHead(7);
            myLinkedList.AddAtHead(3);
            myLinkedList.AddAtHead(2);
            myLinkedList.AddAtHead(5);
            myLinkedList.AddAtTail(5);
            myLinkedList.Get(5);
            myLinkedList.DeleteAtIndex(6);
            myLinkedList.DeleteAtIndex(4);


            Console.ReadLine();
        }