heap, merge and quick sort