treers

Sedgewick's Tree Maps, simple implementations

Travis Status Version GitHub Issues GitHub Pull Requests Downloads License GitHub last commit Twitter

About

This is a hobby project, simple rewrite of Sedgewick's tree structures in Rust.

Contribute

Please contribute, feel free to write an issue, there are still plenty things to improve (such as improvement of docs).

Tree Maps

~~Interfaces~~ Traits

| Name | Description | |-----------------------------|:------------------------:| | new | New Instance of Tree Map | | size | Count of items in map | | get | Fetch an value in map by key | | put | Insert by key-value | | height | Tree Height | | is_empty | Checks if map is empty | | contains | Returns true if item exists | | min | Retrieve a minimum key in map | | max | Retrieve a maximum key in map | | delete | TODO |

| Name | Description | |-----------------------------|:------------------------:| | preorder | Pre Order Traversal; DFS | | inorder | In Order Traversal; DFS | | postorder | Post Order Traversal; DFS | | levelorder | Level Order Traversal; BFS |

BST - Binary Search Tree

| Algorithm | Average | Worst Case | |-----------|---------|:---------:| | Space | O(n) | O(n) | | Search | O(log n) | O(n) | | Insert | O(log n) | O(n) |

Red-Black Tree

| Algorithm | Average | Worst Case | |-----------|---------|:---------:| | Space | O(n) | O(n) | | Search | O(log n) | O(log n) | | Insert | O(log n) | O(log n) |

BTree - Balanced Tree

| Algorithm | Average | Worst Case | |-----------|---------|:---------:| | Space | O(n) | O(n) | | Search | O(log n) | O(log n) | | Insert | O(log n) | O(log n) |

Documentation

https://docs.rs/treers

TODO

Resources

Authors

License

Licensed under the MIT License.