Method
printResult
(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) { |
Tested by
no test coverage detected