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

                Linkedlist.push(7);
                Linkedlist.push(1);
                Linkedlist.push(3);
                Linkedlist.push(2);

                Console.Write("Created Linked list is: ");
                Linkedlist.PrintList();

                Linkedlist.DeleteNode(1);
                Console.WriteLine();
                Console.Write("Created Linked list is: ");
                Linkedlist.PrintList();
            }
            static void Main(string[] args)
            {
                LinkedListMethods Linkedlist = new LinkedListMethods();

                Linkedlist.push(7);
                Linkedlist.push(1);
                Linkedlist.push(3);
                Linkedlist.push(2);
                Linkedlist.push(8);

                Console.Write("Linked list before deletion is: ");
                Linkedlist.PrintList();

                Linkedlist.DeleteNode(4);
                Console.WriteLine();
                Console.Write("Linked list after deletion is: ");
                Linkedlist.PrintList();
            }