Skip to content

Commit cf658c2

Browse files
committed
clean tree leaf path code
1 parent 43e07b9 commit cf658c2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

PuzzleCoding/src/TreeLeafPath.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
/**
66
* print out all leaf node path with non recursive method
77
* The structure of node is *NOT* binary tree, is just a normal tree.
8-
* <p/>
9-
* <p/>
10-
* // print out all leaf node path
8+
*
9+
* print out all leaf node path
1110
* // 12
1211
* // 4 8 22
1312
* //1 2 3 9 18 24
14-
* <p/>
13+
*
1514
* the output is like:
16-
* <p/>
15+
*
1716
* 12, 4, 1,
1817
* 12, 4, 2,
1918
* 12, 4, 3,
@@ -78,6 +77,9 @@ public static void main(String[] args) {
7877
TreeLeafPath node9 = new TreeLeafPath(9);
7978
TreeLeafPath node18 = new TreeLeafPath(18);
8079
TreeLeafPath node22 = new TreeLeafPath(22);
80+
TreeLeafPath node16 = new TreeLeafPath(16);
81+
82+
node18.addTree(node16);
8183
node18.addTree(node22);
8284
node8.addTree(node9);
8385
node8.addTree(node18);

0 commit comments

Comments
 (0)