Skip to content

Commit a8da4ea

Browse files
refactor 958
1 parent 6e0e9c2 commit a8da4ea

File tree

1 file changed

+0
-33
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-33
lines changed

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

-33
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,6 @@
55
import java.util.LinkedList;
66
import java.util.Queue;
77

8-
/**
9-
* 958. Check Completeness of a Binary Tree
10-
*
11-
* Given a binary tree, determine if it is a complete binary tree.
12-
* Definition of a complete binary tree from Wikipedia:
13-
* In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible.
14-
* It can have between 1 and 2h nodes inclusive at the last level h.
15-
*
16-
* Example 1:
17-
* 1
18-
* / \
19-
* 2 3
20-
* / \ /
21-
* 4 5 6
22-
*
23-
* Input: [1,2,3,4,5,6]
24-
* Output: true
25-
* Explanation: Every level before the last is full (ie. levels with node-values {1} and {2, 3}),
26-
* and all nodes in the last level ({4, 5, 6}) are as far left as possible.
27-
*
28-
* Example 2:
29-
* 1
30-
* / \
31-
* 2 3
32-
* / \ \
33-
* 4 5 7
34-
* Input: [1,2,3,4,5,null,7]
35-
* Output: false
36-
* Explanation: The node with value 7 isn't as far left as possible.
37-
*
38-
* Note:
39-
* The tree will have between 1 and 100 nodes.
40-
* */
418
public class _958 {
429
public static class Solution1 {
4310
public boolean isCompleteTree(TreeNode root) {

0 commit comments

Comments
 (0)