(Binary search tree is a binary tree where each node can have 2 children atmost, the right being larger than the node, and the left should be smaller than the node.)
I have a theory that i want to disprove. It says that for any binary tree, the if we take a search path (call it S) to a leaf node, then any node on the LEFT of S must be smaller than any node on S, and any node of the RIGHT must be larger than any node on S. In other words: node on left < node on S < node on right. Is there any counter-example to disprove this theory?
For example if we have this tree:
A search path for node K would be M->F->H->K
The set of nodes on the left contains C, A, D, G
The set on the right contains V,S,P,T,X,W
What is a good counter example?
Thank you.
C, A, D, Gare to the left ofM->F-H->K? - BlorgbeardM->F->C->A. TheDnode is the right of the line, but is not larger thanMorF. - Blorgbeard