A binary search tree (BST) is more than a tree of nodes — it is a tree that obeys an ordering property: for every node, all keys in its left subtree are smaller, and all keys in its right subtree are larger. Insertion and search are the two operations that both depend on and preserve this property. When you insert, you start at the root and repeatedly move left or right by comparing the new key to the current node, until you reach an empty spot where the new node belongs. Search follows the exact same path logic, except it stops when it finds a match or runs out of nodes to visit.
This matters in COP3530 because the BST is the first structure where the shape of the data determines performance. Each comparison discards roughly half of the remaining tree when the tree is reasonably balanced, giving O(log n) behavior for both insert and search. But insert values in sorted order and the tree degenerates into a chain — a linked list in disguise — and performance collapses to O(n). Understanding why requires connecting the insertion logic to the resulting tree height, not just memorizing two complexity classes.
As you watch, keep three things in view. First, track the comparison at each node and notice that insertion and search share identical traversal logic. Second, watch how the code expresses this — iteratively with a while loop and a trailing parent pointer, or recursively by returning subtrees. Third, pay attention to the examples used: ask yourself what the tree would look like if the same keys had arrived in a different order, and what that does to the number of comparisons.
A focused walkthrough of the BST insertion operation, covering how a new key is placed so that the ordering property is preserved. Based on the title and description, expect step-by-step tracing of how the algorithm descends from the root, comparing the new key at each node to decide whether to go left or right, until it finds the empty position where the node attaches. At nearly eighteen minutes, it has room to work through concrete examples rather than just state the rule.
CodeWithHarry is a well-established programming channel, and this video's single-operation focus matches the Insertion Logic subtopic directly, giving you the comparison-by-comparison reasoning before you try to write it in code.
A broader treatment of binary search trees that explains the structure and then implements it in Java with worked examples, from the Geekific data structures series. Expect coverage of the BST ordering property as the defining constraint, followed by code for the core operations including insertion and search. The implementation portion shows how node classes and tree classes are organized in practice.
Seeing a full class-based implementation — node definition, tree class, insert and search methods — gives you the structural template you will translate into your own JavaScript version, and the explanation-then-code format reinforces why each line of code exists.
A compact four-minute explanation of binary search, the halving strategy that underlies BST search performance. It covers how repeatedly discarding half of the remaining candidates produces logarithmic running time, with accompanying code linked in the description. This is the algorithmic idea that explains why BST search is fast when the tree is well-shaped.
Michael Sambol's videos are known for being tight and accurate, and this one isolates the halving intuition you need to understand the best-case O(log n) result — and, by contrast, why a degenerate tree that never halves anything degrades to O(n).
Together these videos reinforce the ordering property that separates a BST from a general binary tree (MO1) and supply the insert and search logic you must be able to apply by hand while keeping that property intact (MO3). The Geekific implementation demonstrates the Node and tree class structure with working insert and search methods, giving you a concrete model to adapt when building your own JavaScript BST (MO5). The binary search video supplies the halving argument behind logarithmic performance, which is the foundation for reasoning about how tree height — and therefore insertion order and balance — drives the gap between best-case and worst-case cost for both operations (MO4).
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.