Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita8da4ea

Browse files
refactor 958
1 parent6e0e9c2 commita8da4ea

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,6 @@
55
importjava.util.LinkedList;
66
importjava.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
publicclass_958 {
429
publicstaticclassSolution1 {
4310
publicbooleanisCompleteTree(TreeNoderoot) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp