Skip to content

Commit 8300923

Browse files
committed
Runtime: 12 ms (Top 70.59%) | Memory: 17.4 MB (Top 21.88%)
1 parent 75406a5 commit 8300923

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/M/Maximum Width of Binary Tree/Maximum Width of Binary Tree.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
// Runtime: 12 ms (Top 70.59%) | Memory: 17.4 MB (Top 21.88%)
12
/*
23
Run BFS and store the index of the node when it was stored in the flattened manner.
34
Take the diff of each of the level and keep traking of max value
45
56
*/
67
class Solution {
78
public:
8-
9+
910
int widthOfBinaryTree(TreeNode* root) {
1011
if(!root) return 0;
1112
int res = 0;
@@ -25,4 +26,4 @@ class Solution {
2526
}
2627
return res;
2728
}
28-
};
29+
};

0 commit comments

Comments
 (0)