Tree DFS - Post-order Traversal

trees · function

Description

Given the root of a binary tree, return a list of node values in
post-order: left subtree, then right subtree, then the node itself.

Example:
        1
       / \
      2   3
     / \
    4   5

Post-order: [4, 5, 2, 3, 1]

Constraints

- 0 <= number of nodes <= 1000
- Node values are integers
- Return [] for an empty tree
solution.py
output
Run the cases to see results here.