Exercise 14.3.2
Rewrite the code for
INTERVAL-SEARCHso that it works properly when all intervals are open.
This is pretty minor, and I'm not gonna bother doing the full thing. We need to do to things to the code in Exercise 14.3-1:
- change the definition of
overlapsto exclude the boundary conditions, that is, change<=to<in the comparisons; - use
>instead of>=when comparingnode.left.maxandinterval.lowinTree.search.