How to perform bottom-up construction of heaps?
Five nodes is plenty to make a tree. See for example here. His first example has 6 nodes, not 5, but it should get you started.

A heap is a binary tree with all levels filled except, perhaps, the last. The last level is filled in left-to-right until you run out of elements.

So yours would start out like this:



The heap invariant is that each parent is smaller than both its children. In the heap construction algorithm you work bottom up, restoring the heap invariant. One way to do this is a recursive post-order tree traversal:

Heapify (x):
    if (x-&gt;is_leaf) return x
    l = Heapify (x-&gt;left_child)
    if (exists(x-&gt;right_child)):
        r = Heapify (x-&gt;right_child)
        if ((r-&gt;value &lt; x-&gt;value) &amp;&amp; (r-&gt;value &lt; l-&gt;value)):
            swap(r-&gt;value, x-&gt;value)                    # r-&gt;value was smallest
    if (l-&gt;value &lt; x-&gt;value):
        swap(l-&gt;value, x-&gt;value)                        # l-&gt;value was smallest
    return x


In actual code for heaps the heap is often represented as an array with the elements stored top-to-bottom and left-to-right in each level. The first element is the root, the second and third elements are the children of the root, and so on. In this case you can do the initial heap creation by working backwards through the array to get a post-order tree traversal for cheap (i.e., as an iterative algorithm that doesn't need to recurse).