The question is: given a sequence of numbers, find an algorithm that determines if the sequence of numbers is in post order traversal of a binary search trees.
Up to now, I have understood the following:
- In the post order traversal of the binary tree it follows Left, Right, Root. So the Left value has to be less than the Right value.
- The last element of the sequence is the root, assuming the sequence was in the post order traversal.
I do not know how to progress further with this. Also, is there a way to create a Divide and Conquer algorithm for this?