예제 #1
0
        /// <summary>
        /// this method traverses our entire linked list and prints all the data
        /// </summary>
        public void printAll()
        {
            LinkedListNode_int thisNode = start;

            while (thisNode != null)
            {
                Console.WriteLine(thisNode.Data);
                thisNode = thisNode.next;
            }
        }
예제 #2
0
 private void AddToBeginning(LinkedListNode_int lln)
 {
     if (start == null)
     {
         start = lln;
         end   = lln;
     }
     else
     {
         lln.next = start;
         start    = lln;
     }
 }
예제 #3
0
        public void AddToBeginning(int newInt)
        {
            LinkedListNode_int newNode = new LinkedListNode_int(newInt);

            AddToBeginning(newNode);
        }