//majority element of an array // element with frequency > (n/2) {n: size of array} //time complexity : O(n) || space complexity : O(1) #include using namespace std; void ismaj(int arr[],int n,int exp_maj){ // checks the if the candidate element is actually the majority element or not int i=0; int count =0; for(i=0;i(n/2)){ cout<<"majority element : "<>size; int *arr = new int[size]; for(int i=0;i>arr[i]; } int result = majelement(arr,size); ismaj(arr,size,result); return 0; }