An algorithm to find out most frequent N words in a file