aboutsummaryrefslogtreecommitdiff
path: root/src/splay.mli
diff options
context:
space:
mode:
Diffstat (limited to 'src/splay.mli')
-rwxr-xr-xsrc/splay.mli30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/splay.mli b/src/splay.mli
new file mode 100755
index 0000000..41c1a5a
--- /dev/null
+++ b/src/splay.mli
@@ -0,0 +1,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