im_ternary_tree 0.0.2

Structural sharing ternary tree, i.e. immutable data structure
Documentation

Structrual sharing Ternary Tree in Rust

a bit like 2-3 finger three, but not very like... WIP

Docs https://docs.rs/im_ternary_tree/ .

Usage

use im_ternary_tree::TernaryTreeList;

println!("{}", TernaryTreeList::<usize>::from(&[]));

// assoc
let origin5 = [1, 2, 3, 4, 5];
let data5 = TernaryTreeList::from(&origin5);
let updated = data5.assoc(3, 10);

println!("{}", data5.format_inline());
println!("{}", updated.format_inline());

assert_eq!(updated.unsafe_get(3), 10);

Known Issues

  • Balancing is not ensured, thus unstable performance

License

MIT