Choose true statement: I – Binary search is faster than linear search. II –…

2022

Choose true statement: I – Binary search is faster than linear search. II – Binary search may not be applied on all the input lists on which linear search can be applied.

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 416 students.

Show answer & explanation

Correct answer: C

  • I: Binary search is faster than linear search ( O(log⁡n) vs O(n).

  • II: Binary search works only on sorted lists, while linear search works on any list.

Concept:

Statement 1: Binary search is faster than linear search.

True, Unless the array size is tiny, binary search is faster than linear search. However, sorting the array is required before doing a binary search. In contrast to binary search, there exist specialized data structures created for quick searching, such as hash tables.

Statement 2: Binary search may not be applied on all the input lists on which linear search can be applied.

True, Binary search is applied only on the sorted list it cannot apply to an unsorted list. Whereas linear search is applicable for all types of lists. It means sorted or unsorted type of lists.

Hence the correct answer is: Both I and II.

Explore the full course: Up Lt Grade Assistant Teacher 2025