Exercise: Binary Tree Post-order III labuladong Original About 5931 words
968. 监控二叉树 https://leetcode.cn/problems/binary-tree-cameras 968. Binary Tree Cameras https://leetcode.com/problems/binary-tree-cameras 979. 在二叉树中分配硬币 https://leetcode.cn/problems/distribute-coins-in-binary-tree 979. Distribute Coins in Binary Tree https://leetcode.com/problems/distribute-coins-in-binary-tree 1080. 根到叶路径上的不足节点 https://leetcode.cn/problems/insufficient-nodes-in-root-to-leaf-paths 1080. Insufficient Nodes in Root to Leaf Paths https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths 2049. 统计最高分的节点数目 https://leetcode.cn/problems/count-nodes-with-the-highest-score 2049. Count Nodes With the Highest Score https://leetcode.com/problems/count-nodes-with-the-highest-score Prerequisite Knowledge
Before reading this article, you should first learn:
Writing code in postorder traversal is the most elegant. It can access the parent node (via function parameters) and the subtree (by collecting return values from recursion). Some challenging problems may require using both of these features simultaneously.
Prev
Exercise: Binary Tree Post-order II
Next
Exercise: Binary Tree Level I