We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e97182 commit 44fa387Copy full SHA for 44fa387
src/main/java/com/fishercoder/solutions/_662.java
@@ -66,6 +66,10 @@
66
Note: Answer will in the range of 32-bit signed integer.
67
*/
68
public class _662 {
69
+ /**
70
+ * Use a map to store the node to value map,
71
+ * we use root as index 1, then its left child is 2*i-1 and right child is 2*i
72
+ */
73
public int widthOfBinaryTree(TreeNode root) {
74
if (root == null) {
75
return 0;
0 commit comments