Post-Order Traversal
Domain: Data Structures
π― Motivation
Visit left subtree, then right subtree, then root last. Useful for deleting trees or calculating folder sizes.
π Concrete Example
For tree A(B(D,E), C): post-order gives D, E, B, C, A. The root is visited last in each subtree.
π Analogy
Calculating the total size of a folder: you must add up all subfolder sizes first (children), then add the folderβs own size (root) last.