Exemplo n.º 1
0
 private void preorderPrinting(Node node) {
   if (node != null) {
     System.out.print(node.getData() + " ");
     preorderPrinting(node.getLeft());
     preorderPrinting(node.getRight());
   }
 }
Exemplo n.º 2
0
 public void preorderPrinting() {
   preorderPrinting(root);
 }