Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 701f071

Browse files
[LEET-000] organize comments
1 parent e0aa328 commit 701f071

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

leetcode-algorithms/src/main/java/com/stevesun/solutions/BinaryTreeLongestConsecutiveSequence.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@
55
/**
66
* Given a binary tree, find the length of the longest consecutive sequence path.
77
8-
The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The longest consecutive path need to be from parent to child (cannot be the reverse).
8+
The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connections.
9+
The longest consecutive path need to be from parent to child (cannot be the reverse).
910
1011
For example,
11-
1
12+
1
1213
\
1314
3
1415
/ \
1516
2 4
16-
\
17-
5
17+
\
18+
5
1819
Longest consecutive sequence path is 3-4-5, so return 3.
19-
2
20-
\
21-
3
22-
/
23-
2
20+
21+
2
22+
\
23+
3
24+
/
25+
2
2426
/
25-
1
27+
1
2628
Longest consecutive sequence path is 2-3,not3-2-1, so return 2.
2729
*/
2830
public class BinaryTreeLongestConsecutiveSequence {

0 commit comments

Comments
 (0)