Implement heap sort with MaxHeap
Fix a bug in Sort()