A sorting algorithm using a minimum heap as a datastructure