------
## 最终结论
```python
def pancake_sort(arr):
    def flip(sub_arr, k):
        return sub_arr[:k+1][::-1] + sub_arr[k+1:]

    n = len(arr)
    for i in range(n):
        max_index = arr.index(max(arr[:n-i]))  # 找到当前未排序部分的最大元素的位置
        if max_index != n-i-1:
            arr = flip(arr, max_index)  # 将最大元素翻转到前面
            arr = flip(arr, n-i-1)      # 将最大元素翻转到当前未排序部分的末尾
    return arr

# Test cases
assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]
assert pancake_sort([98, 12, 54, 36, 85]) == [12, 36, 54, 85, 98]
assert pancake_sort([41, 42, 32, 12, 23]) == [12, 23, 32, 41, 42]
```