Majority Element in array with O(N) Time complexity
// { Driver Code Starts //Initial Template for C # include < stdio.h > # include < stdbool.h > // } Driver Code Ends //User function Template for C // Function to find majority element in the array // a: input array // size: size of input array int majorityElement ( int a [] , int size) { int count = 1 , cand = 0 ; for ( int i = 1 ; i < size ; i ++ ){ if (a[ cand ] == a[ i ]){ count ++ ; } else { count -- ; } if ( count == 0 ){ cand = i ; count = 1 ; } } count = 0 ; for ( int j = 0 ; j...