We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
An alternative solution I've made is to do an in order traversal of the tree. And since every subsequent node must be greater than the precedent node, any node that fails this condition means that the tree is not a valid binary search tree.
Trees: Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →
An alternative solution I've made is to do an in order traversal of the tree. And since every subsequent node must be greater than the precedent node, any node that fails this condition means that the tree is not a valid binary search tree.