Here is the function I wrote for traversing an interval tree. I notice it fails to visit some nodes though. Assuming the code is pretty clear, I want to know where it fails.
public boolean searchTree(Node node,int x)
{
while(node!=null&&!node.getInterval().containsPoint(x))
{
if(node.getNodeLeft()!=null&&(node.getNodeLeft().getMax()>=x))
{
node=node.getNodeLeft();
}
else
{
node=node.getNodeRight();
}
}
return node!=null;
}