(left, right)
| 85 | |
| 86 | |
| 87 | def merge(left, right): |
| 88 | result = [] |
| 89 | while left and right: |
| 90 | if left[0] <= right[0]: |
| 91 | result.append(left.pop(0)); |
| 92 | else: |
| 93 | result.append(right.pop(0)); |
| 94 | while left: |
| 95 | result.append(left.pop(0)); |
| 96 | while right: |
| 97 | result.append(right.pop(0)); |
| 98 | return result |
| 99 | |
| 100 | |
| 101 | def quickSort(arr, left=None, right=None): |