Beispiel #1
0
        // a Deep copy
        public OurList(OurList aList)
        {
            mFirst = null;
             OurListNode pCopy = aList.mFirst;

             while (pCopy != null)
             {
            PushBack(pCopy.mData);
            pCopy = pCopy.mNext;
             }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            OurList myList = new OurList();
             for (int i = 0; i < 10; i++)
            myList.PushBack(i);

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

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