Beispiel #1
0
        /// <summary>
        /// This method creates a new Linked list with 2 nodes.
        /// </summary>
        static void instantiateList()
        {
            Node node1 = new Node(7);
            Node node2 = new Node(9);

            SLinkedList numList = new SLinkedList(node1);

            numList.Append(node2.Data);

            numList.Print();
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine(" It's a small world after all.");
            Console.WriteLine(" ");
            Console.WriteLine(" ");

            SLinkedList newList = new SLinkedList();

            newList.Insert(5);
            Console.WriteLine($"{newList}");
            newList.Append(25);
            newList.InsertAfter(17, 12);
            newList.InsertBefore(25, 16);
            newList.Print();
        }