示例#1
0
        static void Main(string[] args)
        {
            List   list     = new List();
            bool   aBoolean = true;
            char   bChar    = '$';
            int    cInteger = 12312;
            string dString  = "Barış Can Yılmaz";

            list.InsertAtFront(aBoolean); //true
            list.print();
            list.InsertAtFront(bChar);    //$ true
            list.print();
            list.InsertAtLast(cInteger);  //$ true 13212
            list.print();
            list.InsertAtLast(dString);   //$ true 13212 Barış Can Yılmaz
            list.print();

            object removeObject;

            try
            {
                removeObject = list.RemoveFromFront();
                Console.WriteLine(removeObject + " removed");
                list.print();

                removeObject = list.RemoveFromBack();
                Console.WriteLine(removeObject + " removed");
                list.print();

                removeObject = list.RemoveFromFront();
                Console.WriteLine(removeObject + " removed");
                list.print();

                removeObject = list.RemoveFromBack();
                Console.WriteLine(removeObject + " removed");
                list.print();
            }
            catch (Exception e)
            {
                Console.WriteLine("Hata " + e);
            }
        }