How to Search in a Binary Search Tree (BST) - Step by Step Explanation with Examples
N
Neural Lantern
3 Views • May 02, 2026
Description
In this video we walk through how to perform searches in a Binary Search Tree. Starting with a perfectly balanced BST, we cover the search process step by step, including finding existing nodes like 73 and determining that numbers like 44 do not exist in the tree.
We discuss time complexity for searches in BSTs - O(log n) on average for balanced trees and O(n) in the worst case when the tree becomes skewed like a linked list due to sorted or bad data. Learn why each comparison eliminates half the remaining data and how height affects performance.
Perfect for students learning data structures and algorithms. If you're studying BSTs, this clear explanation will help you understand searching, insertion paths, and why self-balancing trees matter.
Thanks for watching!
00:00 Introduction to BST Search
00:31 BST Not Self-Balancing
00:40 Average Case Log Time
00:53 Linear Time in Worst Case
01:13 How BST Search Works
01:18 Search Path Example
02:08 Searching for Existing Node
02:35 Searching for Non-Existent Node
03:19 Tree Size and Height
03:30 Time Complexity O(h)
05:40 Bad Data Example
08:23 Skewed Tree Like Linked List
09:53 Linear Time in Worst Case
11:58 Why Log Time
12:36 Halving the Search Space
14:14 O(log n) Summary
14:28 Conclusion
binary search tree, BST search, binary search tree tutorial, data structures, algorithms, BST explained, search in BST, binary tree search, tree traversal, log n time, data structures and algorithms, computer science, programming tutorial
=-=-=-=-=-=-=-=-=
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
- Twitter / X: https://x.com/NeuralLantern
- Rumble: https://rumble.com/c/c-3696939
- BitChute: https://www.bitchute.com/channel/pg1Pvv5dN4Gt
- Daily Motion: https://www.dailymotion.com/neurallantern
- Minds: https://www.minds.com/neurallantern/
- Odysee: https://odysee.com/@NeuralLantern:5
Please show your support!
- Buy me a coffee: https://ko-fi.com/neurallantern
- Subscribe + Sharing on Social Media
- Leave a comment or suggestion
- Subscribe to the Blog: https://www.NeuralLantern.com
- Watch the main "pinned" video of this channel for offers and extras
We discuss time complexity for searches in BSTs - O(log n) on average for balanced trees and O(n) in the worst case when the tree becomes skewed like a linked list due to sorted or bad data. Learn why each comparison eliminates half the remaining data and how height affects performance.
Perfect for students learning data structures and algorithms. If you're studying BSTs, this clear explanation will help you understand searching, insertion paths, and why self-balancing trees matter.
Thanks for watching!
00:00 Introduction to BST Search
00:31 BST Not Self-Balancing
00:40 Average Case Log Time
00:53 Linear Time in Worst Case
01:13 How BST Search Works
01:18 Search Path Example
02:08 Searching for Existing Node
02:35 Searching for Non-Existent Node
03:19 Tree Size and Height
03:30 Time Complexity O(h)
05:40 Bad Data Example
08:23 Skewed Tree Like Linked List
09:53 Linear Time in Worst Case
11:58 Why Log Time
12:36 Halving the Search Space
14:14 O(log n) Summary
14:28 Conclusion
binary search tree, BST search, binary search tree tutorial, data structures, algorithms, BST explained, search in BST, binary tree search, tree traversal, log n time, data structures and algorithms, computer science, programming tutorial
=-=-=-=-=-=-=-=-=
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
- Twitter / X: https://x.com/NeuralLantern
- Rumble: https://rumble.com/c/c-3696939
- BitChute: https://www.bitchute.com/channel/pg1Pvv5dN4Gt
- Daily Motion: https://www.dailymotion.com/neurallantern
- Minds: https://www.minds.com/neurallantern/
- Odysee: https://odysee.com/@NeuralLantern:5
Please show your support!
- Buy me a coffee: https://ko-fi.com/neurallantern
- Subscribe + Sharing on Social Media
- Leave a comment or suggestion
- Subscribe to the Blog: https://www.NeuralLantern.com
- Watch the main "pinned" video of this channel for offers and extras
More from User
20:46
Graph Basics in Data Structures: Nodes, Edges, and Representations
Neural Lantern
26:46
4 Graph Types: Undirected vs Directed, Weighted vs Unweighted
Neural Lantern
25:33
AVL Trees: Adding Linear Data and Performing Rotations
Neural Lantern
36:36
AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step
Neural Lantern
16:03
How to Perform AVL Tree Rotations - Step By Step Example
Neural Lantern
25:14
AVL Tree Rotations Tutorial: Fixing Imbalance After Adding a Node
Neural Lantern
Related Videos
29:57
Binary Search Tree Insertion Tutorial: Building a BST from Scratch Step by Step
Neural Lantern
30:23
Binary Search Tree Definition Explained Step by Step
Neural Lantern
01:30
Examples & Explanations Legal Writing, Second Edition (Examples and Explanations)
ahyangedeon88
00:17
*D.O.W.N.L.O.A.D* Examples Explanations for Wills, Trusts, and Estates (Examples Explanations
zucedi
01:30
Examples & Explanations for Federal Income Tax (Examples & Explanations Series)
ahyangedeon88
00:40
Examples and Explanations: Property, 4th Edition (Examples Explanations)
zenaligo