Add heap sort implementation

Could you also add a test for empty and 1-length arrays?