Skip to content

Commit 9298be0

Browse files
committed
Adding readme file
1 parent b0735fa commit 9298be0

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Given the root of a binary tree, return the postorder traversal of its nodes' values.
2+
3+
 
4+
Example 1:
5+
6+
7+
Input: root = [1,null,2,3]
8+
9+
Output: [3,2,1]
10+
11+
Explanation:
12+
13+
14+
15+
16+
Example 2:
17+
18+
19+
Input: root = [1,2,3,4,5,null,8,null,null,6,7,9]
20+
21+
Output: [4,6,7,5,2,9,8,3,1]
22+
23+
Explanation:
24+
25+
26+
27+
28+
Example 3:
29+
30+
31+
Input: root = []
32+
33+
Output: []
34+
35+
36+
Example 4:
37+
38+
39+
Input: root = [1]
40+
41+
Output: [1]
42+
43+
44+
 
45+
Constraints:
46+
47+
48+
The number of the nodes in the tree is in the range [0, 100].
49+
-100 <= Node.val <= 100
50+
51+
52+
 
53+
Follow up: Recursive solution is trivial, could you do it iteratively?

0 commit comments

Comments
 (0)