retagged by
398 views
1 votes
1 votes
Assume  an array A[1,……..,n] has n elements, and every element of an array is less than or equal to n.An element is said to be “majority element”,if it is occured in more than n/2 positions of an array.What is the time complexity to check whether the majority element exist or not in the given array?[Best answer]

a)O(logn)                                      b)O(n)

c)O(nlogn)                                    d)O(n^2)
retagged by

1 Answer

Answer:

Related questions

0 votes
0 votes
1 answer
2
Ray Tomlinson asked Aug 9, 2023
465 views
How many times is the comparison $i >= n$ performed in the following program?int i = 200 n = 80; main() { while (i >= n) { i = i - 2 n = n + 1 } }
0 votes
0 votes
1 answer
4
Ray Tomlinson asked Aug 9, 2023
515 views
Numerical Answer Type Que?(please Try to give some ahortcut trick also or important concept is there to solve that question )