make `freevalfunc` optional in init()
first implementation of iterators
rewrite `rebalance` to be more idiomatic
AVL tree implementation for Hare (WIP).
use avltree;
use fmt;
use sort::cmp;
export fn main() void = {
let tree = avltree::init(&cmp::ints);
defer avltree::finish(&tree);
avltree::ins(&tree, &1);
avltree::ins(&tree, &0);
avltree::ins(&tree, &2);
match (avltree::search(&tree, &2)) {
case void =>
fmt::println("unable to find value '2'")!;
case let node: *avltree::avlnode =>
fmt::println("found node with value '2'")!;
};
};
# make install
The package provides avltree
Hare module. See haredoc
for usage details.
Please send patches to ~artoj/public-inbox@lists.sr.ht
using git send-email with prefix set to hare-avltree
:
$ git config format.subjectPrefix "PATCH hare-avltree"