Q. What is the primary requirement for using binary search?
-
A.
The array must be sorted
-
B.
The array must be unsorted
-
C.
The array must contain unique elements
-
D.
The array must be of fixed size
Solution
Binary search requires the array to be sorted in order to function correctly.
Correct Answer:
A
— The array must be sorted
Learn More →
Q. Which of the following data structures can be used to implement binary search?
-
A.
Linked List
-
B.
Array
-
C.
Stack
-
D.
Queue
Solution
Binary search is typically implemented on arrays due to their ability to provide random access.
Correct Answer:
B
— Array
Learn More →
Q. Which of the following is a real-world application of binary search?
-
A.
Finding a name in a phone book
-
B.
Sorting a list of numbers
-
C.
Traversing a tree
-
D.
Inserting an element in a queue
Solution
Binary search is commonly used to find a name in a sorted phone book efficiently.
Correct Answer:
A
— Finding a name in a phone book
Learn More →
Showing 1 to 3 of 3 (1 Pages)