Binary Search Trees (BST) Concepts

Introduction

A binary search tree (BST) is a binary tree with one extra rule attached to it: for every node, all values in its left subtree are smaller than the node's value, and all values in its right subtree are larger. That single ordering property is what separates a BST from a general binary tree, and it is the reason a BST can do useful work that an unordered tree cannot. Each node still looks familiar — a data field plus left and right child pointers — but the arrangement of those nodes now carries meaning.

The payoff is search. Because you can compare a target value to the current node and discard an entire subtree in one step, searching a BST resembles binary search on a sorted array: you halve the remaining possibilities at each level rather than inspecting every node. That gives O(log n) behavior when the tree is reasonably balanced. The catch, which this topic also introduces, is that performance depends on height, not on node count alone — inserting already-sorted data produces a long, skinny tree that degrades to O(n), essentially a linked list wearing a tree costume.

As you watch these videos, keep three questions in mind. First, how is the ordering property stated — does it apply only to immediate children, or to entire subtrees? (The subtree version is the correct one.) Second, how does each presenter walk a search path, and can you predict the comparisons before they do? Third, what does the tree look like in the worst case, and what does that do to the running time? You will use these ideas immediately when you move on to insertion, deletion, and your own implementation.

Video 1: Binary Search Trees: Introduction & Properties

CodeWithHarry · 14:28 · 373,063 views · 5y ago · captions — Watch on YouTube

About this video

CodeWithHarry introduces the binary search tree as an ordered or sorted binary tree, working through the defining ordering property and the structural vocabulary that goes with it. Based on the title and description, expect a definition-first treatment with drawn examples showing which trees qualify as BSTs and which do not. The pacing suits a first exposure to the concept.

Why this video

This is the most direct match for the subtopics on the BST ordering property and BST versus general binary tree, and the channel is a well-known, heavily viewed source for introductory data structures explanations.

Video 2: Binary Search Trees (BST) Explained and Implemented in Java with Examples | Geekific

Geekific · 19:57 · 36,955 views · 5y ago · captions — Watch on YouTube

About this video

Geekific explains BSTs conceptually and then implements one in Java, so you see the node structure — data plus left and right references — turned into actual class definitions. The video follows the channel's broader tree series and includes concrete examples, with source code available through the linked repository. At roughly twenty minutes it is the longest and most detailed of the three.

Why this video

Seeing the Node and tree classes written out reinforces the BST node structure subtopic and gives you a code-level model you can translate into JavaScript for your own implementation work.

Video 3: Binary Search Tree Data Structure | BST Introduction | Searching, Implementation | DSAOne Course #66

Anuj Kumar Sharma · 12:24 · 41,279 views · 4y ago · captions — Watch on YouTube

About this video

Anuj Kumar Sharma introduces the BST within the DSAOne course sequence, and the description signals an explicit comparison with other data structures alongside searching and implementation. Expect coverage of why the ordering property makes lookups fast and a walkthrough of the search procedure itself. It is the shortest of the three and works well as a focused review.

Why this video

The comparison framing and the emphasis on searching line up closely with the subtopics on how BST ordering enables efficient search and on BST performance relative to other structures.

How These Videos Support the Learning Outcomes

Together these videos target the conceptual half of the module. All three establish the BST ordering property and contrast a BST with a general binary tree, which is the distinguishing skill named in MO1, and each demonstrates the search procedure that underlies MO3 and motivates the height-versus-performance reasoning in MO4. The Geekific implementation video models the Node and tree class design you will need for MO5, even though it uses Java rather than JavaScript — the structure transfers directly. Traversal algorithms (MO2) and the three deletion cases (MO3) are developed in other topics of this module, so treat these videos as the foundation those later operations build on.

About These Videos

These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.