2080 7

CSC211 ยท 2080 ยท 5 marks

Explain binary search with an example. What is the time complexity of binary search?

Explain binary search with an example. What is the time complexity of binary search? [5]

Data Structures and AlgorithmsChapter 7: Searching and HashingIntroduction to Searching, Search Algorithms

Binary search is a searching algorithm that works only on a sorted list of elements. It repeatedly divides the search space in half by comparing the target element with the middle element of the current sublist, eliminating half of the remaining elements at each step. --- 1. Find the middle eleme...