Binary Search Tree

Darshna Rekha
9 min readMay 27, 2023

An important principle in computer science is data representation — which we widely know as Data structure. A well-structured data can help in efficient searching. But which data structure? Will a linked list work for all kinds of searches?

While searching we have two things at our disposal:

  1. Data structure — how the data is organised
  2. Search key — what we want to search

The first factor is the data structure. We should choose the one that makes the search more efficient. We need two more details before we chose the correct data structure.

  1. Relationship among the data
  2. Identifying the boundary of search with the help of the search key

The relationship is one factor in deciding which data structure will suit our purpose. Let us explore a data structure that works great when the data can be compared with one another — that is an item is either greater or smaller than the other.

Binary Search Tree

Introducing Binary Search Tree

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

  • The left subtree of a node contains only nodes with keys lesser than the node’s key.
  • The right subtree of a node contains only nodes with…

--

--

Darshna Rekha

💼 Software Engineer at Cisco Systems, Inc. 🎯 Learn - Code - Repeat 📚 If I am not coding, I am reading