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)
Consider the two invalid cases below. Domingos solution accounts for both.