Binary Search Explained: O(log N) | Searching and Sorting



Binary search finds a key the way you find a word in a dictionary: open the middle and throw away half. This lesson covers the two conditions it needs: the list must be sorted, and any element must be reachable in constant time. That is why it works on arrays but not on linked lists. We trace the five-step algorithm on a sorted array of eight numbers. Then we use 8 to 4 to 2 to 1 to show why binary search runs in O(log N) time. This is part 1 of 3 on binary search, for B Tech 3rd semester data structures, Unit 3.

Chapters:
00:00 Binary Search (1/3): Idea & Conditions
00:16 The Idea and Two Conditions
00:51 The 5 Steps: Search for 41
01:33 Why It’s O(log N): 8 → 4 → 2 → 1
01:54 Recap

Part of the course: Searching and Sorting – 16 Nov-26 (Lesson 3)

source

Leave a Reply

Your email address will not be published. Required fields are marked *

You might like

© 2026 Cantinho do Vídeo - WordPress Video Theme by WPEnjoy