Module Int_set


module Int_set: sig .. end
Mutable finite sets of non-negative integers.

Testing membership and adding an element are O(log(N)), where N is the largest element in the set.

The representation uses a compressed form of a complete d-ary tree, and so is space efficient when the integers in the set form contiguous ranges. More precisely, the space used is O(log(N) * R), where R is the number of contiguous ranges in the 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
val mem : t -> int -> bool
val add : t -> int -> unit
val add_range : t -> lo:int -> hi:int -> unit
val min_element : t -> int option
val max_element : t -> int option