Commit Graph

3 Commits

Author SHA1 Message Date
destroycomputers
de44dd5412 Loosen constraint on the Key type in rb & avl tree
The current constraint on the `init_ordered' function accepts only
numeric types. While one still can init a non-numerically-keyed tree by
passing a comparator explicitly, the reason to disallow non-numeric
ordered types is nowhere to be found.
2024-06-18 13:31:45 +02:00
Jeroen van Rijn
410876b36a Add core:container/rbtree
Add a red-black tree with configurable $Key and $Value.
Also includes tests that verify it maintains RB invariants, doesn't leak.

Originally based on the CC0 implementation from literateprograms.org.
But reworked to the same API used by @Yawning's excellent `core:container/avl` for ease of use.
2024-05-23 23:00:00 +02:00
Yawning Angel
874d6ccb60 core/container/avl: Initial import 2024-02-24 14:05:15 +09:00