static void Main(string[] args)
        {
            SLL S = new SLL();

            S.add(5);
            S.add(19);
            S.add(15);
            S.print();
            S.search(19);
            S.search(5);
            S.update(5, 8);


            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SLL LL = new SLL();

            Console.WriteLine("This is the Add First method");
            LL.AddFirst(1);
            LL.AddFirst(2);
            LL.AddFirst(3);
            DisplayList(LL.Head);

            Console.WriteLine("This is the Add Last method, 5 and 6 are added to the end of the list");
            LL.AddLast(5);
            LL.AddLast(6);
            DisplayList(LL.Head);

            Console.WriteLine("this is the Add before method, I have chosen to add 8 before the value of 3");
            LL.AddBefore(8, 3);
            DisplayList(LL.Head);
            Console.ReadLine();

            Console.WriteLine();
        }