๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Programming Concepts Beginner

What is Binary Search?

An efficient search algorithm that finds a target value in a sorted array by repeatedly dividing the search interval in half.

Binary search compares the target to the middle element. If smaller, search the left half; if larger, search the right half. Each step eliminates half the remaining elements, giving O(log n) time complexity โ€” searching 1 million items takes at most 20 comparisons.

Prerequisites: the data must be sorted. Binary search is used in database index lookups, dictionary searches, and finding insertion points. Variations include lower/upper bound searches and bisection methods for continuous functions.

Related Terms

Queue
A data structure that follows First-In-First-Out (FIFO) ordering, where elements are added at the rear and removed from the front.
Agile
A software development methodology that emphasizes iterative development, collaboration, and rapid response to change.
Observer Pattern
A design pattern where an object (subject) maintains a list of dependents (observers) that are notified automatically of state changes.
Twelve-Factor App
A methodology of twelve best practices for building modern, scalable, maintainable software-as-a-service applications.
Concurrency
The ability of a program to manage multiple tasks that can make progress during overlapping time periods.
Recursion
A programming technique where a function calls itself to solve a problem by breaking it into smaller subproblems.
View All Programming Concepts Terms โ†’