Adding the heapsort algorithm to the array example.