TreesLesson 27Free preview
DSA Post-order Traversal
This lesson is part of DSA · All levels
Summary
Post-order traversal visits left subtree, right subtree, new node. This sequence ensures that the child is processed before the parent, so it is suitable for removing the entire tree, calculating the size of the subtree, or evaluating arithmetic expressions. The complexity remains.
Key points
- Order of visits: left, right, root
- The child is processed before the mother, suitable for bottom-up operations
- It's often used to remove trees and evaluate expressions.
- Complexity
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.