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

Commit e4ec942

Browse files
add todo for 222
1 parent ddc166e commit e4ec942

File tree

1 file changed

+8
-3
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+8
-3
lines changed

src/main/java/com/fishercoder/solutions/_222.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import com.fishercoder.common.classes.TreeNode;
44

55
/**
6+
* 222. Count Complete Tree Nodes
7+
*
68
* Given a complete binary tree, count the number of nodes.
7-
* <p>
9+
*
810
* Definition of a complete binary tree from Wikipedia:
911
* In a complete binary tree every level,
1012
* except possibly the last, is completely filled,
@@ -13,7 +15,7 @@
1315
*/
1416
public class _222 {
1517

16-
class Solution1 {
18+
class SolutionRecursive {
1719
/**reference: https://discuss.leetcode.com/topic/21317/accepted-easy-understand-java-solution/2*/
1820
public int countNodes(TreeNode root) {
1921
int leftH = getLeftHeight(root);
@@ -39,11 +41,14 @@ private int getLeftHeight(TreeNode root) {
3941
}
4042
return height;
4143
}
42-
4344
}
4445

4546
public static void main(String...args) {
4647
System.out.println(1 << 3);
4748
}
4849

50+
class SolutionIterative {
51+
/**TODO: implement an iterative solution*/
52+
}
53+
4954
}

0 commit comments

Comments
 (0)