Browse thread
[Caml-list] Suggestion about balanced trees in stdlib
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Mattias Waldau <mattias.waldau@a...> |
| Subject: | RE: [Caml-list] Suggestion about balanced trees in stdlib |
> - operations on intervals: "iter_interval", "fold_interval",
> and "interval"
In order to solve the mentioned operations, I usually use Splay-trees,
which is part of the CDK. They have the following operations.
val floor: 'a t -> key -> key * 'a
(* [floor s c] returns the greatest element with [key <= c] *)
val ceil: 'a t -> key -> key * 'a
(* [ceil s c] returns the smallest element with [key >= c] *)
val prev: 'a t -> key -> key * 'a
(* [prev s c] returns the greatest element with [key < c] *)
val next: 'a t -> key -> key * 'a
(* [next s c] returns the smallest element with [key > c] *)
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners