|
| 1 | +<h2><a href="https://leetcode.com/problems/binary-tree-postorder-traversal/">145. Binary Tree Postorder Traversal</a></h2><h3>Easy</h3><hr><p>Given the <code>root</code> of a binary tree, return <em>the postorder traversal of its nodes' values</em>.</p> |
| 2 | + |
| 3 | +<p> </p> |
| 4 | +<p><strong class="example">Example 1:</strong></p> |
| 5 | +<img alt="" src="https://assets.leetcode.com/uploads/2020/08/28/pre1.jpg" style="width: 127px; height: 200px;" /> |
| 6 | +<pre> |
| 7 | +<strong>Input:</strong> root = [1,null,2,3] |
| 8 | +<strong>Output:</strong> [3,2,1] |
| 9 | +</pre> |
| 10 | + |
| 11 | +<p><strong class="example">Example 2:</strong></p> |
| 12 | + |
| 13 | +<pre> |
| 14 | +<strong>Input:</strong> root = [] |
| 15 | +<strong>Output:</strong> [] |
| 16 | +</pre> |
| 17 | + |
| 18 | +<p><strong class="example">Example 3:</strong></p> |
| 19 | + |
| 20 | +<pre> |
| 21 | +<strong>Input:</strong> root = [1] |
| 22 | +<strong>Output:</strong> [1] |
| 23 | +</pre> |
| 24 | + |
| 25 | +<p> </p> |
| 26 | +<p><strong>Constraints:</strong></p> |
| 27 | + |
| 28 | +<ul> |
| 29 | + <li>The number of the nodes in the tree is in the range <code>[0, 100]</code>.</li> |
| 30 | + <li><code>-100 <= Node.val <= 100</code></li> |
| 31 | +</ul> |
| 32 | + |
| 33 | +<p> </p> |
| 34 | +<strong>Follow up:</strong> Recursive solution is trivial, could you do it iteratively? |
0 commit comments