/// <summary>
 /// Print the double linked list .
 /// </summary>
 /// <param name="startNode"></param>
 public static void PrintList(DoublyLinkedListNode <T> startNode)
 {
     Console.WriteLine("\n\n[LinkedListUtilities]Printing List. ");
     if (startNode == null)
     {
         //Debug.
         Console.WriteLine("\t[LinkedListUtilities] :Empty List.");
     }
     else
     {
         //Set up an pointer .
         var pointer = startNode;
         //Pointer not null.
         while (pointer != null)
         {
             //Debug.
             Console.WriteLine("{0}", pointer.Info);
             //Move forward.
             pointer = pointer.Next;
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///     Doubly Linked list Constructor .
 /// </summary>
 public DoublyLinkedListNode()
 {
     //Initialize both of the reference to the null.
     Previous = null;
     Next     = null;
 }