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

Method printAsTree

java/Chapter 17/Question17_13/QuestionB.java:64–72  ·  view source on GitHub ↗
(BiNode root, String spaces)

Source from the content-addressed store, hash-verified

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

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected