Multiple choice

Let A[1,....n] be an array storing a bit (1 or 0) at each location, and f (m) is a function whose time complexity is è(m). Consider the following program fragment written in a C like language:

The complexity of this program fragment is

  1. $\Omega$(n2)
  2. $\Omega$ (nlogn) and O(n2)
  3. $\theta$(n)
  4. O (n)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Here the fragment of code contains for loop which goes from 1 to n. Since due to given conditions m < n. So complexity of code is $\Theta$ 6(n)