BinaryTree t ← 產生二元樹
time ← 1  

# 走訪二元樹 t 的節點 u 的函式
postorder(u):
    if u = NIL:
        return
    postorder(t.nodes[u].left)
    postorder(t.nodes[u].right)
    L[u] ← time++

# 以二元樹的根節點為起點,開始走訪
postorder(t.root)