1.

C++ program to find the majority element in an array of integers

Answer»

Answer:

WRITE a function which TAKES an ARRAY and PRINTS the majority element (if it exists), otherwise prints “No Majority Element”. A majority element in an array A[] of size n is an element that APPEARS more than n/2 times (and hence there is at most one such element).



Discussion

No Comment Found