0

I have come across algorithms that can create a BST if any two of the 3 traversals are given (there would be three different algorithms for the 3 combinations)

This is an example

I was wondering, is it guaranteed that a tree generated would be unique? Or rather, can multiple trees be generated satisfying the two traversals?

I am pretty certain that there will only be one tree that satisfies two traversals, because that is how everyone treats the problem, and it seems somewhat logical, but I have never seen it written explicitly anywhere.

Any sources that answer theoretical questions like this about Binary Search Trees would be helpful as well.

0 Answers0