Program to sort elements by frequency in a given array is discussed here. You need to print the elements of an array in the decreasing frequency and if 2 numbers have same frequency then print the one which came first.
Asked in recruitment drives of companies like Wipro, Microsoft, Pay pal, Sap Labs
@@coding::1@@
@@coding::2@@
@@coding::3@@