Searching Sorted Data
Learn about binary search and its most pivotal application.
We'll cover the following
Binary search
The method we used for guessing a number is known as binary search. Perhaps the most important application of binary search is searching sorted data.
Searching sorted data
Searching is a fundamental problem. Given a sequence and an element , we would like to check whether is present in this sequence. For example, is present in the sequence and is not present in this sequence. Given the importance of the search problem, it is not surprising that Python has built-in methods for solving it.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.