When searching for a value in a very large sorted array, which algorithm is generally more efficient?
Binary search
Linear 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 hash table.
The data must be stored in a linked list.
The data must be sorted.
If you need to perform frequent insertions or deletions in the middle of a dataset, is binary search the most suitable choice?
Yes
No
In a rotated sorted array [5, 6, 7, 1, 2, 3, 4], what is the pivot element?
4
1
5
7
How does Binary Search handle duplicate elements in a sorted array?
It throws an error as Binary Search requires unique elements.
It returns the index of the last occurrence of the target element.
It returns the index of the first occurrence of the target element.
It returns the index of any one occurrence of the target element.
What is the primary advantage of using binary search over linear search for a sorted array?
Binary search can handle duplicate elements more efficiently.
Binary search has a faster time complexity in most cases.
Binary search is easier to implement.
Binary search uses less memory.
In Binary Search, if the target value is less than the middle element, what should be the next step?
Search the entire array again.
Search the right half of the array.
Conclude the target is not present.
Search the left half of the array.
What is the time complexity of Binary Search in the best-case scenario?
O(n)
O(log n)
O(1)
O(n log n)
Which data structure inherently benefits from the efficiency of binary search for searching operations?
Linked List
Hash Table
Binary Search Tree
Queue
Which of the following best describes the advantage of binary search over linear search?
Binary search has a faster average-case time complexity.
Binary search can be used on unsorted data.