Heapsort does not work when I use a function pointer.