PublicShow -- Red black trees

Red-Black trees are balanced search binary trees. They are named because nodes can be classified as either red or black. The code we include is based on "Introduction to Algorithms", second edition, by Cormen, Leiserson, Rivest and Stein. The library includes routines to insert, lookup and delete elements in the tree.

A Red black tree is represented as a term t(Nil, Tree), where Nil is the Nil-node, a node shared for each nil-node in the tree. Any node has the form colour(Left, Key, Value, Right), where colour is one of red or black.

- Vitor Santos Costa, Jan Wielemaker, Samer Abdallah
See also
- "Introduction to Algorithms", Second Edition Cormen, Leiserson, Rivest, and Stein, MIT Press
Source rb_new(-Tree) is det
Create a new Red-Black tree Tree.
- Use rb_empty/1.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source rb_empty(Arg1)
Source rb_lookup(Arg1, Arg2, Arg3)
Source rb_in(Arg1, Arg2, Arg3)
Source rb_del_max(Arg1, Arg2, Arg3, Arg4)
Source rb_del_min(Arg1, Arg2, Arg3, Arg4)
Source rb_previous(Arg1, Arg2, Arg3, Arg4)
Source rb_next(Arg1, Arg2, Arg3, Arg4)
Source list_to_rbtree(Arg1, Arg2)
Source ord_list_to_rbtree(Arg1, Arg2)
Source is_rbtree(Arg1)
Source rb_size(Arg1, Arg2)
Source rb_min(Arg1, Arg2, Arg3)
Source rb_max(Arg1, Arg2, Arg3)
Source rb_partial_map(Arg1, Arg2, Arg3, Arg4)
Source rb_clone(Arg1, Arg2, Arg3)
Source rb_map(Arg1, Arg2, Arg3)
Source rb_fold(Arg1, Arg2, Arg3, Arg4)
Source rb_map(Arg1, Arg2)
Source rb_keys(Arg1, Arg2)
Source rb_visit(Arg1, Arg2)
Source rb_update(Arg1, Arg2, Arg3, Arg4)
Source rb_update(Arg1, Arg2, Arg3, Arg4, Arg5)
Source rb_apply(Arg1, Arg2, Arg3, Arg4)
Source rb_insert(Arg1, Arg2, Arg3, Arg4)
Source rb_insert_new(Arg1, Arg2, Arg3, Arg4)
Source rb_delete(Arg1, Arg2, Arg3)
Source rb_delete(Arg1, Arg2, Arg3, Arg4)