Max heap and heap sort