You are viewing a single comment's thread. Return to all comments →
Is the equal in >= from:
if(root.data <= min || root.data >= max)
...ever reached? Wouldn't the equivalence in <= be reached first and then never needing the second one? Therefore only needing this:
if(root.data <= min || root.data > max)
Seems like cookies are disabled on this browser, please enable them to open this website
Trees: Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →
Is the equal in >= from:
if(root.data <= min || root.data >= max)
...ever reached? Wouldn't the equivalence in <= be reached first and then never needing the second one? Therefore only needing this:
if(root.data <= min || root.data > max)