Just some tiny optimizations

According to CLRS. Introduction to Algorithms. 3rd ed. Page 156. Section 6.3 n/2 to n are actually the leaves of the heap. Therefore in the building heap part, we can just run a loop in the `range(n/2, -1, -1)`.

In the sorting function, the last element is in its position. Similar as above, we don't need to do extra work here.