コード例 #1
0
ファイル: OurList.cs プロジェクト: mikebanks/cSharp-programs
        static void Main(string[] args)
        {
            OurList myList = new OurList();

            for (int i = 0; i < 10; i++)
            {
                myList.PushBack(i);
            }
            myList.Display();

            Console.WriteLine("The 5th value on the list is {0}", myList.GetNthValue(5));
            myList.Clear();
            for (int i = 0; i < 10; i++)
            {
                myList.PushBack(i);
            }

            myList.Display();
            Console.WriteLine("The 6th value on the list is {0}", myList.GetNthValue(6));
            myList.Clear();
            for (int i = 0; i < 10; i++)
            {
                myList.PushBack(i);
            }

            myList.Display();
            Console.WriteLine("The 12th value on the list is {0}", myList.GetNthValue(12));

            Console.WriteLine();
            Console.WriteLine("Press any key to continue ...");
            Console.ReadKey();
        }
コード例 #2
0
ファイル: OurList.cs プロジェクト: mikebanks/cSharp-programs
        public OurList(OurList aList)       // a Deep copy
        {
            mFirst = null;
            OurListNode pCopy = aList.mFirst;

            while (pCopy != null)
            {
                PushBack(pCopy.mData);
                pCopy = pCopy.mNext;
            }
        }
コード例 #3
0
ファイル: OurList.cs プロジェクト: mikebanks/cSharp-programs
        // a Deep copy
        public OurList(OurList aList)
        {
            mFirst = null;
                OurListNode pCopy = aList.mFirst;

                while (pCopy != null)
                {
                    PushBack(pCopy.mData);
                    pCopy = pCopy.mNext;
                }
        }
コード例 #4
0
ファイル: OurList.cs プロジェクト: mikebanks/cSharp-programs
        static void Main(string[] args)
        {
            OurList myList = new OurList();
                for (int i = 0; i < 10; i++)
                    myList.PushBack(i);
                    myList.Display();

                Console.WriteLine("The 5th value on the list is {0}", myList.GetNthValue(5));
                myList.Clear();
                for (int i = 0; i < 10; i++)
                   myList.PushBack(i);

               myList.Display();
               Console.WriteLine("The 6th value on the list is {0}", myList.GetNthValue(6));
               myList.Clear();
               for (int i = 0; i < 10; i++)
                   myList.PushBack(i);

                myList.Display();
                Console.WriteLine("The 12th value on the list is {0}", myList.GetNthValue(12));

                Console.WriteLine();
                Console.WriteLine("Press any key to continue ...");
                Console.ReadKey();
        }