Postorder Traversal

An interactive, step-by-step visualisation of Postorder Traversal.

Category
Trees
Time complexity
O(n)
Space complexity
O(h)

Pseudocode

postorder(t):
  postorder(t.left)
  postorder(t.right)
  visit(t)

Reference implementation

def postorder(t, out):
    if not t: return
    postorder(t.l, out); postorder(t.r, out); out.append(t.v)

Open the interactive Postorder Traversal visualisation →