University project, implementation of Binary Search Tree data structure without usage of STL containers.
- Default constructor (can specify comparison criteria when constructing)
- Copy/Move constructors
- Initializer list constructor (can specify comparison criteria when constructing)
- Copy/Move operators
- Serialize/Deserialize function
- Insert
- Emplace
- Remove
- Search
- Clear
- Root
- Size
- Min
- Max
- Save/Read to/from file using << / >> operator
- Insert element using << operator
- Forward Iterator (inorder)
- Reverse Iterator (inorder)
First inserted element is the root.
- Clone repository or download BST.h and LinkedList.h
- Include it to your project
#include <iostream>
#include "BST.h"
int main(){
simple::BinarySearchTree<int> iTree{12, 35, 20, 68};
simple::BinarySearchTree<char> cTree{'b', 's', 't'};
for(const auto &e:iTree){
std::cout << e << "\n";
}
}
LinkedList.h