4 releases
0.2.2 | Dec 22, 2020 |
---|---|
0.2.1 |
|
0.2.0 | Dec 6, 2020 |
0.1.1 | Dec 2, 2020 |
0.1.0 | Dec 2, 2020 |
#2515 in Data structures
52KB
708 lines
binary_search_tree
Description
A classic Binary Search Tree written in Rust.
In this implementation, each node of the binary tree contains only one valuable value. To order the nodes, the elements must implement the Ord
trait.
Usage
As a library
extern crate binary_search_tree;
use binary_search_tree::BinarySearchTree;
Features & capabilities
The BinarySearchTree struct provides the following methods:
- Viewing the root element
- Is the tree empty
- Insertion
- Insertion without duplicating
- Check for the presence of an element in the tree
- Viewing the minimum
- Viewing the maximum
- Extracting the minimum
- Extracting the maximum
- Deleting an arbitrary value
- Successor
- Predecessor
- Viewing the number of items in the tree
- Clearing the tree
- Viewing values in the tree in ascending order
- Moving the tree to a sorted vector
- Creating a tree with elements from an iterator
- Extending the tree with elements from the iterator
- Inorder traversal
- Reverse order traversal
- Preorder traversal
- Postorder traversal
- Level order traversal
If you have any comments or suggestions, or you suddenly found an error, please write to prototyperailgun@gmail.com.