Skip to content

Commit c470ce6

Browse files
refactor 662
1 parent 9358a2b commit c470ce6

File tree

1 file changed

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

1 file changed

+0
-61
lines changed

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

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,67 +9,6 @@
99
import java.util.Map;
1010
import java.util.Queue;
1111

12-
/**
13-
* 662. Maximum Width of Binary Tree
14-
*
15-
* Given a binary tree, write a function to get the maximum width of the given tree.
16-
* The width of a tree is the maximum width among all levels.
17-
* The binary tree has the same structure as a full binary tree, but some nodes are null.
18-
* The width of one level is defined as the length between the end-nodes
19-
* (the leftmost and right most non-null nodes in the level,
20-
* where the null nodes between the end-nodes are also counted into the length calculation.
21-
22-
Example 1:
23-
Input:
24-
25-
1
26-
/ \
27-
3 2
28-
/ \ \
29-
5 3 9
30-
31-
Output: 4
32-
Explanation: The maximum width existing in the third level with the length 4 (5,3,null,9).
33-
34-
Example 2:
35-
Input:
36-
37-
1
38-
/
39-
3
40-
/ \
41-
5 3
42-
43-
Output: 2
44-
Explanation: The maximum width existing in the third level with the length 2 (5,3).
45-
46-
Example 3:
47-
Input:
48-
49-
1
50-
/ \
51-
3 2
52-
/
53-
5
54-
55-
Output: 2
56-
Explanation: The maximum width existing in the second level with the length 2 (3,2).
57-
Example 4:
58-
Input:
59-
60-
1
61-
/ \
62-
3 2
63-
/ \
64-
5 9
65-
/ \
66-
6 7
67-
68-
Output: 8
69-
Explanation:The maximum width existing in the fourth level with the length 8 (6,null,null,null,null,null,null,7).
70-
71-
Note: Answer will in the range of 32-bit signed integer.
72-
*/
7312
public class _662 {
7413
public static class Solution1 {
7514
/**

0 commit comments

Comments
 (0)