source and test code for heap-sort.