CLRS Chapter 6 pseudocode implemented in swift, includes a heap class