-
Hey ppl, this question was asked in amazon technical round. The aspirants were given a binary tree and they had to check whether this tree is a binary search tree or not. Can anyone suggest an algorithm???0
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Replies
-
Member • Jul 25, 2011
This article may help:
#-Link-Snipped-#Are you sure? This action cannot be undone. -
Member • Jul 26, 2011
Binary Search Trees have a constraint of left node and sub nodes of the main node to be smaller and the right node and sub nodes to be larger than the main node. Using that constraint you can manually verify it. 😀 Do you need a program or something for it? 😐Are you sure? This action cannot be undone. -
Member • Jul 26, 2011
@biroramani: thanks for the link....😀
@praveen: nah i got it.....actually i was confused about taking the range for the starting element and i did a mistake in recursion.....now its working completely fine....thanks anyway.....😀Are you sure? This action cannot be undone. -
Member • Jul 26, 2011
Oh Sure, anytime... 😀Are you sure? This action cannot be undone.