MCPcopy
hub / github.com/hustcc/JS-Sorting-Algorithm / merge

Function merge

src/pythonSortTest.py:87–98  ·  view source on GitHub ↗
(left, right)

Source from the content-addressed store, hash-verified

85
86
87def 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
101def quickSort(arr, left=None, right=None):

Callers 1

mergeSortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected