What is the primary difference between Binary Search and Interpolation Search?
Binary Search always divides the array in half, while Interpolation Search estimates the position of the target element.
Binary Search only works on sorted arrays, while Interpolation Search can work on unsorted arrays.
Binary Search is faster than Interpolation Search in all cases.
Binary Search requires more memory than Interpolation Search.
Which of the following is a prerequisite for using binary search on a dataset?
The data must contain only numerical values.
The data must be stored in a linked list.
The data must be sorted.
The data must be stored in a hash table.
Which of the following best describes the time complexity of binary search in the average case?
O(n log n)
O(1)
O(n)
O(log n)
In the context of Binary Search, what is the problem with searching in an infinitely sized array?
Binary Search is too slow for infinitely sized arrays.
Binary Search requires the entire array to be loaded into memory.
Binary Search cannot handle duplicate elements in an infinitely sized array.
Binary Search cannot handle arrays with no defined end.
What is the base case in a recursive implementation of binary search?
When the middle element equals the target element.
When the target element is found.
Both option1 and option2
When the search interval becomes empty.
If you need to perform frequent insertions or deletions in the middle of a dataset, is binary search the most suitable choice?
No
Yes
You have a sorted array that has been rotated an unknown number of times. Which algorithm is best suited for finding a specific element in this array?
Linear Search
Binary Search
Jump Search
Interpolation Search
What value does binary search return if the target element is not present in the sorted array?
It depends on the implementation
-1
Null
Index where the element should be inserted
What is the key characteristic of an array that makes Binary Search applicable?
The array must contain only positive integers.
The array must be stored in contiguous memory locations.
The array must be sorted.
The array must be of a fixed size.
Which of the following best describes the advantage of binary search over linear search?
Binary search is easier to implement.
Binary search can be used on unsorted data.
Binary search has a faster average-case time complexity.
Binary search uses less memory.