Let s be a sorted array of n integers. Let t(n) denote the time taken for the…

PYQ GATE 2000

Let s be a sorted array of n integers. Let t(n) denote the time taken for the most efficient algorithm to determined if there are two elements with sum less than 1000 in s. Which of the following statements is true?

  1. A.

    t(n) is O(1)

  2. B.

    n ≤ t(n) ≤ n log₂ n

  3. C.

    n log₂ n ≤ t(n) < (n choose 2)

  4. D.

    t(n) = (n choose 2)

Attempted by 320 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…