What this library is

BinarySearchTree is a header-only C++17 container for unique values stored in comparator order. It uses std::unique_ptr for node ownership, exposes bidirectional iterators, and intentionally keeps the implementation approachable for learning and small projects.

Highlights

Header-only distribution

Add include/ to the compiler include path and start using the tree without a library build step.

Comparator-aware ordering

Use BinarySearchTree<T, Compare> to define sort order without rewriting the container.

STL-style operations

Insertion, lookup, erase, bounds, iterators, and traversal helpers follow familiar naming and behavior.

Built for readable docs

The API reference and guides are structured for scanning code, checking complexity, and finding examples quickly.

Documentation map

Getting Started

Installation, include path, first example, and local build commands.

API Reference

Constructors, modifiers, lookup helpers, iterators, traversal methods, and utilities.

Examples

Basic usage, custom comparators, custom objects, iterator patterns, and traversal snippets.

Important note

This is a plain Binary Search Tree, not a self-balancing AVL or Red-Black tree. Sorted or nearly sorted insertion orders can produce a tall tree and degrade average behavior to worst-case O(N).