title: Understanding how to create a heap in Python
body: <p>The <code>collections.Count.most_common</code> function in Python uses the <code>heapq</code> module to return the count of the most common word in a file, for instance.</p>
  
  <p>I have traced through the <code>heapq.py</code> file, but I'm having a bit of trouble understanding how a heap is created/updated with respect to words let's say.</p>
  
  <p>So, I think the best way for me to understand it, is to figure out how to create a heap from scratch.</p>
  
  <p>Can someone provide a pseudocode for creating a heap that would represent word count?</p>