title: Algorithm: A Better Way To Calculate Frequencies of a list of words
body: <p>This question is actually quite simple yet I would like to hear some ideas before jumping into coding. Given a file with a word in each line, <b>calculating most n frequent numbers.</b></p>
  
  <p> The first and unfortunately only thing that pops up in my mind use to use a <code>std::map</code>. I know fellow C++'ers will say that <code>unordered_map</code> would be so much reasonable. </p>
  
  <p>I would like to know if anything could be added to the algorithm side or this is just basically 'whoever picks the best data structure wins' type of question. I've searched it over the internet and read that hash table and a priority queue might provide an algorithm with <b>O(n)</b> running time however I assume it will be to complex to implement </p>
  
  <p>Any ideas?</p>