MCPcopy Index your code
hub / github.com/careercup/ctci / printResult

Method printResult

java/Chapter 4/Question4_4/QuestionBFS.java:38–49  ·  view source on GitHub ↗
(ArrayList<LinkedList<TreeNode>> result)

Source from the content-addressed store, hash-verified

36 }
37
38 public static void printResult(ArrayList<LinkedList<TreeNode>> result){
39 int depth = 0;
40 for(LinkedList<TreeNode> entry : result) {
41 Iterator<TreeNode> i = entry.listIterator();
42 System.out.print("Link list at depth " + depth + ":");
43 while(i.hasNext()){
44 System.out.print(" " + ((TreeNode)i.next()).data);
45 }
46 System.out.println();
47 depth++;
48 }
49 }
50
51
52 public static void main(String[] args) {

Callers 1

mainMethod · 0.95

Calls 3

hasNextMethod · 0.80
nextMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected