Exercise: Binary Tree Post-order I
OriginalAbout 2970 words
Prerequisite Knowledge
Before reading this article, you need to learn:
For some problems, if you try to solve them by intuition, you might find that you need to call other recursive functions within your recursive code to calculate certain information. Generally, when this happens, you can consider using a postorder traversal approach to optimize the algorithm. By using postorder traversal, you can pass information from the subtrees, which helps avoid excessively high time complexity.