//! This crate contains Recursive & Iterative Binary Search Tree Implementations. All common
//! This crate contains Recursive & Iterative Binary Search Tree Implementations. All common
//! operations are included along with
//! operations are included along with common traversal iterators.
//!
//!
//! It is important to note that [RecursiveBST] is more likely to `blow the stack.`
//! All elements within the Binary Search Trees _must_ implement the [Ord] trait.
//! For more information on why that is the case, please read [The Story of Tail Call Optimizations in Rust.](https://seanchen1991.github.io/posts/tco-story/)
//!
//!
//! # Basic Usage
//! It is also important to note that [RecursiveBST] is more likely to `blow the stack.`
//! For more information on why that is the case, please read have a look at
//! [The Story of Tail Call Optimizations in Rust.](https://seanchen1991.github.io/posts/tco-story/)
//!
//! ## Author Notes
//!
//! I have made this library with the personal goals of learning and solidifying concepts such
//! as ownership, borrowing, generics and lifetimes. I cannot promise that the implementations are
//! particularly efficient, or if they are, it was not at the forefront of my mind.
//!
//! That being said, there are some areas I would love to improve/include:
//! - Write Rust more idiomatically.
//! - Implement a `pretty_print()` function to display the binary search trees nicely.
//! - Implementing the Drop trait for iterative node cleanup.
//! - Pre-allocating space on the heap for nodes to reduce inefficiency of inserts.
//!
//! I'm more than happy to accept (and encourage) contributions if anyone is kind enough to do so.
//!
//! # Quick Start
//!
//!
//! ```rust
//! ```rust
//! use bst_rs::{BinarySearchTree, IterativeBST, RecursiveBST};
//!
//! // Create new empty binary search trees
//! let mut iterative_bst = IterativeBST::new();
//! assert!(iterative_bst.is_empty());
//!
//! let mut recursive_bst = RecursiveBST::new();
//! assert!(recursive_bst.is_empty());
//!
//! // Insert elements (no duplicates are allowed)
//! iterative_bst.insert(10);
//! iterative_bst.insert(10); // Element is not inserted
//! iterative_bst.insert(5);
//! iterative_bst.insert(2);
//! iterative_bst.insert(15);
//! iterative_bst.insert(25);
//! assert_eq!(iterative_bst.size(), 5);
//!
//! recursive_bst.insert(10);
//! recursive_bst.insert(10); // Element is not inserted