title: Find the Most Frequent Ordered Word Pair In a Document
body: <p>This is a problem from S. Skiena's "Algorithm. Design Manual" book, the problem statement is:</p>
  
  <blockquote>
    <p>Give an algorithm for finding an ordered word pair(e.g."New York")
        occurring with the greatest frequency in a given webpage. 
        Which data structure would you use? Optimize both time and space. </p>
  </blockquote>
  
  <p>One obvious solution is inserting each ordered pair in a hash-map and then iterating over all of them, to find the most frequent one, however, there definitely should be a better way, can anyone suggest anything? </p>