Answer to Question heap-9

It uses index n in array p, which does not exist.