Which of the following data structures are most appropriate for searching a…
2022
Which of the following data structures are most appropriate for searching a key in the list of elements, using Binary and Sequential search algorithms, respectively?
- A.
Linked List and Queue, respectively
- B.
Linked List and Array, respectively
- C.
Array and Linked List, respectively
- D.
Array and Stack, respectively
Attempted by 749 students.
Show answer & explanation
Correct answer: C
Key points: Binary search requires the data to be sorted and needs direct (random) access to elements. Arrays provide O(1) random access, making binary search efficient on arrays with time complexity O(log n).