aboutsummaryrefslogtreecommitdiff
path: root/splay.mli
blob: 41c1a5a376a56e775a7faaa5caadad8534289123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module type KEY = sig

    type 'a t

    val comp: 'a t -> 'b t -> ('a, 'b) Tools.cmp

    val repr: Format.formatter -> 'a t -> unit

end

module Make (El : KEY) : sig

  type t

  (** Create an empty tree *)
  val empty: t

  (** Return the element in the tree with the given key *)
  val find: 'a El.t -> t -> 'a

  (** Add one element in the tree *)
  val add: 'a El.t -> 'a -> t -> t

  (** Check if the key exists *)
  val member: 'a El.t -> t -> bool

  (** Represent the content in dot syntax *)
  val repr: Format.formatter -> t -> unit

end