sets maximum count and stores maximum occured element so far if maximum count becomes greater than n / 2 it breaks out setting the flag
if ( max_ele < count ) { max_ele = count ; ele = arr [ i ] ; if ( max_ele > ( n / 2 ) ) { f = 1 ; break ; } } }