Identifying the range postorder pattern
The range binary postorder technique can solve some special types of binary search tree problems. These are generally medium problems in which we are given a range and need to process every node in the tree within that range. In most problems, to process a node, we need the aggregated values of some function f over all the nodes in its left and right subtree that also lie within the given range. The technique is a mix of binary search and the postorder technique
If the problem statement or its solution follows the generic template below, it can be solved by applying the range postorder technique.
Template:
f over nodes in its left and right subtrees that also lie within the given range.Liking the course? Check our discounted plans to continue learning.