Pregunta de entrevista de Bijak

Print array elements with there frequency in sorted order O(N)