We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75406a5 commit 8300923Copy full SHA for 8300923
scripts/algorithms/M/Maximum Width of Binary Tree/Maximum Width of Binary Tree.cpp
@@ -1,11 +1,12 @@
1
+// Runtime: 12 ms (Top 70.59%) | Memory: 17.4 MB (Top 21.88%)
2
/*
3
Run BFS and store the index of the node when it was stored in the flattened manner.
4
Take the diff of each of the level and keep traking of max value
5
6
*/
7
class Solution {
8
public:
-
9
+
10
int widthOfBinaryTree(TreeNode* root) {
11
if(!root) return 0;
12
int res = 0;
@@ -25,4 +26,4 @@ class Solution {
25
26
}
27
return res;
28
-};
29
+};
0 commit comments