Master Mathematics.

Programming · Searching, Sorting & Complexity · Problem 4

When binary search is O(log n)

For which inputs does binary search take time in the worst case?

  1. (A) An array of n integers in any order
  2. (B) A linked list of n integers in any order
  3. (C) An array of n integers in increasing order
  4. (D) A linked list of n integers in increasing order

Source: GATE DA