title: What is the precise definition of the Heap data structure?
body: <p>The definition of heap given in wikipedia (<a href="http://en.wikipedia.org/wiki/Heap_%28data_structure%29" rel="noreferrer">http://en.wikipedia.org/wiki/Heap_(data_structure)</a>) is</p>
  
  <blockquote>
    <p>In computer science, a heap is a specialized tree-based data structure
    that satisfies the heap property: If A is a parent node of B then
    key(A) is ordered with respect to key(B) with the same ordering
    applying across the heap. Either the keys of parent nodes are always
    greater than or equal to those of the children and the highest key is
    in the root node (this kind of heap is called max heap) or the keys of
    parent nodes are less than or equal to those of the children (min
    heap)</p>
  </blockquote>
  
  <p>The definition says nothing about the tree being complete. For example, according to this definition, the binary tree 5 => 4 => 3 => 2 => 1 where the root element is 5 and all the descendants are right children also satisfies the heap property. I want to know the precise definition of the heap data structure.</p>