Persistent Systems interview question

Implement a heapsort algorithm. Min-Heap Max-Heap concepts.Exceptions,Strings(Java).