Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up

Binary Tree Post Order Traversal

Easy Acceptance 79.59% Points 20

You are given the root of a binary tree. Your task is to return the postorder traversal of the tree.

Examples
Example 1

image Input: root = [1,null,2,3]
Output: [3,2,1]
Explanation: The nodes are visited in Left → Right → Root order.

Example 2

image Input: root = [1,2,3]
Output: [2,3,1]
Explanation: The left subtree is visited first, followed by the right subtree and the root.

Example 3

image Input: root = []
Output: []
Explanation: The tree is empty.

Constraints
    • 0 = Number of nodes = 105
    • -10? = Node.data = 10?
Topics
Tree Recursion Traversal Binary Tree
Companies
Microsoft Oracle
Added 08 Aug 2026 79.59% acceptance
Ln 1, Col 1Sign in to save your code
1 2 3 4 5 6 7
4 5 2 6 7 3 1