Binary Search Tree

Introduction

A binary search tree (BST) is a fundamental data structure in computer science used for efficient searching, insertion, and deletion of elements.

Properties

Algorithm

  1. Start at the root node
  2. If the target value is equal to the current node's value, return the node
  3. If the target value is less than the current node's value, move to the left child
  4. If the target value is greater than the current node's value, move to the right child
  5. Repeat steps 2-4 until the target value is found or until reaching a leaf node

Implementation

Below is an image depicting a binary search tree:

Binary Search Tree

Learn More

For more information about binary search trees, visit the Wikipedia page.