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

Method printResult

java/Chapter 4/Question4_4/QuestionDFS.java:33–44  ·  view source on GitHub ↗
(ArrayList<LinkedList<TreeNode>> result)

Source from the content-addressed store, hash-verified

31 }
32
33 public static void printResult(ArrayList<LinkedList<TreeNode>> result){
34 int depth = 0;
35 for(LinkedList<TreeNode> entry : result) {
36 Iterator<TreeNode> i = entry.listIterator();
37 System.out.print("Link list at depth " + depth + ":");
38 while(i.hasNext()){
39 System.out.print(" " + ((TreeNode)i.next()).data);
40 }
41 System.out.println();
42 depth++;
43 }
44 }
45
46
47 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