Creates a sorted heap from an array. Written in Java. Outputs the stack, the selected item, and the heap for each iteration.