@bittu , I think RLE , would be of no use ; as
inp:AAABBRRGH out :3A2B2R1G1H so to reach the top 5 counts , there will be of no use . as stated earlier by others , HASH TABLE will be the one of best solution for this . maintain hash table in O(n) and then sort it .for top 5 counts. Please mend me if I am wrong somewhere as I am also in a learning phase. On Sat, Jan 8, 2011 at 7:08 AM, bittu <[email protected]> wrote: > RLE run length encoding is another solution because counting sort > eats space whilw with RLE we can do it in > > time complexity O(n) > Space Complexity O(1) > > Correct me if i am wrong ...i m talking about possibility not > exactness. > > Regards > Shashank > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Lalit Kishore Sharma IIIT Allahabad (Amethi Capmus) 5th Sem -- 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.
