You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Binary search is an efficient searching algorithm that works on sorted data. Instead of checking every element one by one, it repeatedly divides the search area in half, quickly narrowing down the location of the target value.
Binary search only works on sorted data (either ascending or descending order). If the data is unsorted, you must sort it first before applying binary search, or use linear search instead.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.