Divide the array into two parts and then find the count of occurrences of x in both the parts
return count ( arr , low , ( low + high ) / 2 , x ) + count ( arr , 1 + ( low + high ) / 2 , high , x ) ; }