(arr1)
| 1 | # coding:utf-8 |
| 2 | # 快排 |
| 3 | def quick_sort(arr1): |
| 4 | if len(arr1) < 2: |
| 5 | return arr1 |
| 6 | else: |
| 7 | pivot = arr1[0] |
| 8 | less = [i for i in arr1[1:] if i < pivot] |
| 9 | greater = [j for j in arr1[1:] if j >= pivot] |
| 10 | return quick_sort(less) + [pivot] + quick_sort(greater) |
| 11 | |
| 12 | # 归并 |
| 13 | def merge_sort(arr1): |
nothing calls this directly
no outgoing calls
no test coverage detected