binary search trees

Shortest path in Binary Search Tree

Introduction Another interview question for the most interesting data structure called BST (Binary Search Tree). To know more about BSTs check my previous post. Problem Statement : Given a Binary Search Tree, keyed on positive integers. The task is to find the Shortest path in Binary Search Tree which adds up to the number K. If no such path exists, return a message accordingly. Understanding the problem A node in a binary search tree always has a higher key at its right child compared to its left child. There are many path running from the roots to the leaves. When we add up the key val...
Read More

Building Binary Search Trees – detailed discussion

Introduction This is the second article for Binary Search Trees, to read more about the previous article, please check the topic Binary Search Tree Basics – a detailed discussion. To get updates on the coming articles in the series, please use the Subscribe feature on the right panel. Purpose of article This article will resume from where we concluded in the first article, this is primarily to understand how to build a BST and understand the problems which arise after building Binary Search Trees. Then we will improve over it and find out ways to build better BSTs. Do remember there is a...
Read More

Binary Search Tree Basics – a detailed discussion

Introduction The article Binary Search Tree Basics - a detailed discussion is the first article for Binary Search Trees and the ninth article in the series of non-linear data structures, to read more about the previous article, please check the topic Operations on a binary tree – Hierarchical Datastructure. To get updates on the coming articles in the series, please use the Subscribe feature on the right panel. Purpose of article This article is to discuss Binary Search Tree in Detail, mostly the theory behind a binary search tree and how it is different from a Binary Tree and what all does...
Read More