let rec intersects_range s i j =
if i > j then raise (Invalid_argument "iset_intersects_range") ;
if is_empty s then false
else
let v1, v2 = root s in
if j < v1 then intersects_range (left_branch s) i j
else if v2 < i then intersects_range (right_branch s) i j
else true