Question:

Choose the statements that are correct.
Options:
(A) For Binary Search, all the elements have to be sorted.
(B) For Linear Search, all the elements have to be sorted.
(C) Linear Search takes less time for searching in worst case than binary search’s worst case.
(D) Linear Search always gives fast result whether elements are sorted or not.
Choose the correct answer from the options given below:

Updated On: Nov 4, 2024
  • (A) only
  • (A) and (C) only
  • (B) and (C) only
  • (A), (B), and (D) only
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Binary search works only on sorted data, with a worst-case complexity of O(log n). Linear search handles unsorted data but has O(n) complexity in the worst case.
Was this answer helpful?
0
0