Fiveable
Fiveable

Binary Search Algorithm

Definition

A binary search algorithm is an efficient searching algorithm that repeatedly divides a sorted list into halves, eliminating half of the remaining elements at each step, until it finds the target value or determines it does not exist.

Analogy

Think of finding a word in a dictionary. Instead of starting from page 1 and flipping through every page, you divide the dictionary in half and decide which half to focus on based on whether your word comes before or after. Repeat this process until you find your word.

Related terms

Linear Search Algorithm: A simple searching algorithm that sequentially checks each element in a list until it finds the target value or reaches the end.

Sorted Data Set: A collection of data arranged in ascending or descending order based on some criteria.

Divide and Conquer: An approach where problems are divided into smaller subproblems, solved independently, and then combined to obtain solutions for larger problems.

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.