Sort And Searching Question:
Download Questions PDF

Explain binary search?

Answer:

Binary search is most useful when the list is sorted. In binary search, element present in the middle of the list is determined. If the key (number to search) is smaller than the middle element, the binary search is done on the first half. If the key (number to search) is greater than the middle element, the binary search is done on the second half (right). The first and the last half are again divided into two by determining the middle element.

Download Sort And Searching Interview Questions And Answers PDF

Previous QuestionNext Question
What is bubble sort algorithm?Do you know what is linear search?