示例#1
0
        static void LinkedListAppend()
        {
            SinglyLinkedList <int> linkedList = new SinglyLinkedList <int>(0);

            linkedList.Append(1);
            linkedList.Append(2);
            linkedList.Append(3);
            linkedList.Append(4);
            linkedList.Append(5);
            linkedList.Append(6);
            linkedList.Print();
        }
示例#2
0
        static void LinkedListInsert()
        {
            SinglyLinkedList <int> linkedList = new SinglyLinkedList <int>(0);

            linkedList.Append(1);
            linkedList.Append(2);
            linkedList.Append(3);
            linkedList.Append(4);
            linkedList.Append(5);
            linkedList.Append(6);
            linkedList.Print();

            linkedList.Insert(65656, 4);
            linkedList.RemoveAtIndex(4);
            linkedList.RemoveAtIndex(0);

            linkedList.Print();

            linkedList.Reverse();
            linkedList.Print();
        }