示例#1
0
        static void Main(string[] args)
        {
            MyList list = new MyList();

            list.AddToEnd(9);
            list.AddToEnd(5);
            list.AddToEnd(11);
            list.AddToEnd(4);
            list.AddToBeginning(9);
            list.AddToBeginning(5);
            list.AddToBeginning(11);
            list.AddToBeginning(4);
            list.AddSorted(9);
            list.AddSorted(5);
            list.AddSorted(11);
            list.AddSorted(4);
            list.Print();
        }
示例#2
0
        static void Main(string[] args)
        {
            if (args == null) throw new ArgumentNullException(nameof(args));
            var myList = new MyList();

            //myList.AddToEnd(5);
            //myList.AddToEnd(2);
            //myList.AddToEnd(8);
            //myList.AddToEnd(7);
            //myList.AddToEnd(11);

            //myList.AddToBeginning(5);
            //myList.AddToBeginning(2);
            //myList.AddToBeginning(8);
            //myList.AddToBeginning(7);
            //myList.AddToBeginning(11);

            myList.AddSorted(5);
            myList.AddSorted(2);
            myList.AddSorted(8);
            myList.AddSorted(7);
            myList.AddSorted(11);

            myList.Print();

            myList.Find(7);
            myList.Min();
            myList.Max();

            myList.Delete(7);
            myList.Print();

            Console.ReadLine();
        }