Example #1
0
        public static void Main()
        {
            DList <int> ml = new DList <int>();

            // Inserting count of 10 members for MyList.
            for (uint i = 10; i < 20; i++)
            {
                ml.insertAt(ml.Length, (int)i);
            }

            for (uint i = 0; i < 10; i++)
            {
                ml.insertAt(ml.Length / 2, -5);
            }

            try
            {
                //ml.removeAll();
                //ml.reverse();
                ml.reverse();


                // Printing MyList's.
                for (uint i = 0; i < ml.Length; i++)
                {
                    Console.WriteLine("{0,2}  {1,2}", i, ml.itemAt(i));
                }
                Console.WriteLine("\nNow MyList's length = " + ml.Length + "\n");
            }
            catch (Exception e) { Console.WriteLine("\nWrong argument item or index, \n" + e.Message + "\n"); }
        }