Skip to content

Commit 2ea915c

Browse files
committed
count no of node
1 parent 58ff1e7 commit 2ea915c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tree/BinaryTree/NoOfNodes.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static int countOfNodes(Node root) {
1010
int left = countOfNodes(root.left);
1111
int right = countOfNodes(root.right);
1212

13-
return left + right;
13+
return left + right + 1;
1414
}
1515

1616
public static void main(String[] args) {

0 commit comments

Comments
 (0)