MinHeap with frequency of data is constructed, then sorting it. But don't see with same frequency it maintains the order of the first appeared element
Regards Surender On Sat, Dec 24, 2011 at 10:57 PM, Ankur Garg <[email protected]> wrote: > how can one do frequency sort . > > Suppose we have an integer array like > > 1,2,3,1,2,3,1,1,2,3,4,4,3,5,3 > > Then 1 is appearing 4 times > 2 - 3 > 3- 5 > 4-2 > 5-1 > > Then if we sort by frequency we shud have this as result > > 5,4,4,2,2,2,1,1,1,1,3,3,3,3,3 > > How to do it > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
