Skip to content

Commit 957c625

Browse files
committed
Runtime: 0 ms (Top 100.00%) | Memory: 50.7 MB (Top 10.84%)
1 parent a469814 commit 957c625

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1+
// Runtime: 0 ms (Top 100.00%) | Memory: 50.7 MB (Top 10.84%)
12
/**
23
* Definition for a binary tree node.
34
* public class TreeNode {
4-
* int val;
5-
* TreeNode left;
6-
* TreeNode right;
7-
* TreeNode() {}
8-
* TreeNode(int val) { this.val = val; }
9-
* TreeNode(int val, TreeNode left, TreeNode right) {
10-
* this.val = val;
11-
* this.left = left;
12-
* this.right = right;
13-
* }
5+
* int val;
6+
* TreeNode left;
7+
* TreeNode right;
8+
* TreeNode() {}
9+
* TreeNode(int val) { this.val = val; }
10+
* TreeNode(int val, TreeNode left, TreeNode right) {
11+
* this.val = val;
12+
* this.left = left;
13+
* this.right = right;
14+
* }
1415
* }
1516
*/
1617
class Solution {
17-
18-
static int count = 0;
19-
18+
19+
static int count = 0;
20+
2021
static void Postorder(TreeNode root){
2122
if(root == null){
2223
return;
@@ -25,10 +26,10 @@ static void Postorder(TreeNode root){
2526
Postorder(root.right);
2627
count++;
2728
}
28-
29+
2930
public int countNodes(TreeNode root) {
3031
count = 0;
3132
Postorder(root);
3233
return count;
3334
}
34-
}
35+
}

0 commit comments

Comments
 (0)