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