module Int_set: Int_set
type
t
include Sexpable
val length : t -> int
val is_empty : t -> bool
val invariant : t -> unit
val to_string : t -> string
val create : ?log2_degree:int -> unit -> t
create ?log2_degree ()
returns an empty set. log2_degree
is the degree
of each node in the tree that represents the set. Must have
log2_degree >= 1
. The default is 4
.val mem : t -> int -> bool
mem t i
checks if i
is in t
.val add : t -> int -> unit
add t i
adds i
to the t
, or does nothing if i
is in t
val add_range : t -> lo:int -> hi:int -> unit
add_range t ~lo ~hi
adds all the integers in the range lo, hi
.
add_range
runs in time proportional to O(log(N)) -- it does not depend
on the size of the range.
Must have 0 <= lo <= hi
.
val min_element : t -> int option
{min,max}_element t
return the smallest and largest elements in t
.val max_element : t -> int option