Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
0
 private void AddToBeginning(LinkedListNode_int lln)
 {
     if (start == null)
     {
         start = lln;
         end   = lln;
     }
     else
     {
         lln.next = start;
         start    = lln;
     }
 }
Ejemplo n.º 3
0
        public void AddToBeginning(int newInt)
        {
            LinkedListNode_int newNode = new LinkedListNode_int(newInt);

            AddToBeginning(newNode);
        }