let rec mem s (n:int) = if is_empty s then false else let v1, v2 = root s in if n < v1 then mem (left_branch s) n else if v1 <= n && n <= v2 then true else mem (right_branch s) n