Skip to content

Latest commit

 

History

57 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple binary (search) tree implemented in Rust

I was inspired by Aria Desires' Learn Rust With Entirely Too Many Linked Lists to implement a binary search tree in Rust. Due to Rust's concept of ownership, it is tricky to implement a linked list. I assumed that it would be similarly challenging to write an "OK" tree.

Quick start

cargo run

System requirements

The Rust compiler now ships with Polonius an alternative library that can replace the borrow checker. I found it easier to implement some of the code using Polonius since the algorithm is "smarter" and allows for safe mutation of members of a struct within the same loop.

To use Polonius, install nightly Rust.

Visualizing the tree

It is possible to render the tree using Graphviz. To achieve this, I've ported the C code from this terrific blog post.

About

Simple binary (search) tree implemented in Rust inspired by "Too Many Linked Lists"

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages