Home

Awesome

Zig rewrite of trees from OpenBSD.

Data structures ported

Usage

See src/main.zig for usage.

To use this library in your project, copy the file into your project and rename it as tree.zig or something.

Note about splay tree

There is potential footgun when freeing nodes of a tree. See test "how to free nodes correctly" in src/main.zig for correct usage.

Enhancements over the original:

Also, the original C impl has some weird design choices, which I will not touch.

Also, invalid data given to the public API will not crash the program.