442 views
1 votes
1 votes
Given a set of n elements not all distinct, the majority element is the one with frequency  >=n/2. So majority element is always the

a. Maximum element

b. Minimum element

c. Mean element

d. Median element

1 Answer

1 votes
1 votes
Option D median element is the correct answer.

In question the definition  of majority is given as the number which have frequency more than and equal to n/2. As we know to find the median Of n elements we have to put them in their value order (sorted) and then have to select the middle element.

so if any array with n elements have a majority value than it must be present as the median of the array.

Related questions

4 votes
4 votes
3 answers
1
1 votes
1 votes
1 answer
2
Anshul Shankar asked Jul 19, 2016
3,806 views
Adacency list is preferred over adjacency matrix when the graph is?A) planarB) DenseC) CliqueD) none of these
1 votes
1 votes
0 answers
4
piyush512 asked 4 days ago
59 views
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element pres...