Implemented path-ahead backtracking heap-sort