MCPcopy Create free account
hub / github.com/careercup/ctci / printAsTree

Method printAsTree

java/Chapter 17/Question17_13/QuestionA.java:62–70  ·  view source on GitHub ↗
(BiNode root, String spaces)

Source from the content-addressed store, hash-verified

60 }
61
62 public static void printAsTree(BiNode root, String spaces) {
63 if (root == null) {
64 System.out.println(spaces + "- null");
65 return;
66 }
67 System.out.println(spaces + "- " + root.data);
68 printAsTree(root.node1, spaces + " ");
69 printAsTree(root.node2, spaces + " ");
70 }
71
72 public static void main(String[] args) {
73 BiNode root = createTree();

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected