Deletion Operations

Introduction

Deletion is the trickiest of the three core binary search tree operations. Insertion and search only ever move downward along a single path, but deletion removes a node that other nodes depend on, so the tree must be repaired afterward. The standard approach breaks the problem into three cases based on how many children the target node has: zero (a leaf), one, or two.

The first two cases are straightforward — a leaf can simply be unlinked from its parent, and a node with a single child can be replaced by that child. The third case requires more care: a node with two children cannot simply be removed, so its value is overwritten with either its in-order successor (the smallest value in the right subtree) or its in-order predecessor (the largest value in the left subtree), and then that replacement node is deleted recursively. Either choice preserves the BST ordering property, which is the invariant everything else in this module depends on.

As you watch, pay attention to three things: how each video identifies which case applies, how the parent pointer or returned subtree reference is reattached after removal, and how the successor or predecessor is located. Try pausing and predicting the resulting tree before the presenter reveals it — tracing deletions by hand is the fastest way to internalize the logic you will later implement in code.

Video 1: Delete a Node in BST | Deletion in BST | Delete a Node in Binary Search Tree | DSA-One Course #68

Anuj Kumar Sharma · 13:17 · 85,597 views · 4y ago · captions — Watch on YouTube

About this video

A walkthrough of node deletion in a binary search tree as part of a broader DSA course series. Based on its title and length, it should cover all three deletion cases with worked diagrams and then translate the logic into code, including how the in-order successor is used when a node has two children.

Why this video

At roughly thirteen minutes it is long enough to treat each case carefully rather than rushing, making it a good primary overview of the three-case framework that organizes this topic.

Video 2: BST Removal Code

Professor Kevin Wortman · 12:16 · 104 views · 4y ago · captions — Watch on YouTube

About this video

A lecture-style video from a university instructor focused specifically on the code for removing an element from a BST, with accompanying slides. Expect close attention to implementation details such as recursive structure, return values, and correctly relinking parent and child references.

Why this video

It complements the conceptual treatment by showing how the three cases appear in actual source code, which directly supports the implementation work later in this module.

Video 3: AVL trees in 5 minutes — Deletions

Michael Sambol · 5:20 · 89,410 views · 3y ago · captions — Watch on YouTube

About this video

A concise explanation of the delete method for AVL trees, a self-balancing variant of the BST. It builds on ordinary BST deletion and then addresses the rotations needed to restore balance after a node is removed.

Why this video

This is an extension video: it shows why preserving BST integrity after deletion matters beyond ordering alone, and previews how tree height and balance affect performance.

How These Videos Support the Learning Outcomes

These videos target MO3 most directly: together they cover all three deletion cases and the role of the in-order successor and predecessor in keeping the ordering property intact. The code-focused walkthrough from Professor Wortman bridges toward MO5 by showing how the case analysis becomes a working delete method with correct reference handling, which you can adapt to your JavaScript BST class. The AVL deletion video supports MO4 by connecting the shape of the tree after modification to height and worst-case performance, while all three reinforce MO1 and MO2 by requiring you to reason about parent-child relationships, leaves, and in-order ordering as you trace each example.

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.