11 Commits

Author SHA1 Message Date
Jeroen van Rijn
27667ce36b iff -> if and only if (⟺) 2026-03-13 11:54:15 +01:00
Laytan Laats
ec040c1fcb rbtree: fix pointer usages 2026-01-11 20:21:25 +01:00
Jeroen van Rijn
7a9ea3ee6d Further overhaul of package line comments. 2025-10-09 23:05:29 +02:00
Jeroen van Rijn
248b0fe9e1 More package lines 2025-10-09 16:11:33 +02:00
Jeroen van Rijn
9c7fe1d8a7 Package lines for core:container. 2025-10-09 14:58:50 +02:00
Sam Mercer
30021e8dac Fix rbtree.find_or_insert
Update the existing node's value if the key is already present and align
documentation with behavior.
2025-08-29 11:02:30 +01:00
Jeroen van Rijn
a0a48bfe34 Fix alignment. 2024-06-27 21:56:26 +02:00
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
11e57fd3fd Address concerns. 2024-05-24 13:58:30 +02:00
Jeroen van Rijn
c43d189a33 Fix package line. 2024-05-24 01:43:17 +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