Ejemplo n.º 1
0
 public void PreOrderTraversal()
 {
     // printing root note
     Console.Write(data + " ");
     // Going to left child
     if (leftNode != null)
     {
         leftNode.PreOrderTraversal();
     }
     // Going to right children
     if (rightNode != null)
     {
         rightNode.PreOrderTraversal();
     }
 }
 public void PreOrderTraversal()
 {
     root?.PreOrderTraversal();
 }