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.
There is no discrepency here. Both statements hold. In the tree there can be equivalent values. If during your search you encounter equivalent values, it IS a binary tree; however, it IS NOT a BST. That would be the difference. In the case of the equivalent values you would return 0.
Trees: Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →
There is no discrepency here. Both statements hold. In the tree there can be equivalent values. If during your search you encounter equivalent values, it IS a binary tree; however, it IS NOT a BST. That would be the difference. In the case of the equivalent values you would return 0.