Binary Search Trees

What is a Binary Search Tree?

A Binary Search Tree, also called a BST, is a data structure that stores values in nodes. Each node can have a left child and a right child. The left side contains smaller values, and the right side contains larger values. This makes searching faster than checking every value one by one.

Important Features

Basic Rules of a BST

  1. Values smaller than the node go to the left.
  2. Values greater than the node go to the right.
  3. Each subtree must also follow the same rule.

Example Image

Diagram of a binary search tree

Learn more about Binary Search Trees here: Binary Search Tree Article