@Navin: In Unix-speak, assuming one word per line in file f:
 
sort f | uniq -c | sort -n -r
 
I'm measuring efficiency by number of characters typed to implement the 
solution.
 
Dave

On Saturday, June 9, 2012 8:51:28 AM UTC-5, Navin Kumar wrote:

> Write an efficient  program that prints the distinct words in its input 
> sorted into decreasing order of frequency of occurrence. Precede each word 
> by its count.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/8MgY3nBx558J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to