Binary Search Tree (BST)

A fundamental data structure in computer science

What is a Binar Search Tree?

A Binary Search Tree is a node-based binary tree data structure with the following properties:

Common Operations

Basic BST Operations

  1. Insert: Add a new node while maintaining BST properties
  2. Search: Find a node with a specific key value
  3. Delete: Remove a node and restructure the tree
  4. Traverse: Visit all nodes in a specific order (in-order, pre-order, post-order)

Time Complexity

Average case: O(log n) for search, insert, and delete operations

Worst case: O(n) when the tree becomes unbalanced (resembles a linked list)

Learn More

For a comprehensive guide on Binary Search Trees, visit: Wikipedia - Binary Search Tree