in Algorithms
740 views
0 votes
0 votes

What should be the time complexity of this one?

Given array of n elements leading element of the array is the element which repeated more than n/2 times in array. What is time complexity to find the leading element in array s.t.

  1. $\theta$($logn)$
  2.  $\theta$(n)
  3. $\theta$ $(nlog n)$
  4. $\theta$$(n^2)$

With a proper explanation, please.

in Algorithms
by
740 views

4 Comments

0
0
The answer given is logn.

That is what confuses me.

I already checked out that link.
0
0
if array is sorred then log n

if array is not sorted  then n
0
0
Answer for this should be theta(n)
0
0

Please log in or register to answer this question.

Related questions