Given the root of a binary tree, return the postorder traversal of its nodes' values. Pattern focus: Postorder DFS (Left Right Root). Visit the left subtree, then the right subtree, and finally the node.
root = binary tree root
postorder traversal as an array of node values
Example 1:
Input:
root = [1,null,2,3]
Output:
[3,2,1]
Explanation:
Postorder visits children before the root.
Example 2:
Input:
root = [1,2,3,4,5,6,7]
Output:
[4,5,2,6,7,3,1]
Explanation:
The traversal processes every subtree before its parent.