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