MCPcopy Create free account
hub / github.com/DasyDong/developer-roadmap / merge

Function merge

code/all_sort.py:21–31  ·  view source on GitHub ↗
(left, right)

Source from the content-addressed store, hash-verified

19 return merge(left_arr1, right_arr1)
20
21def merge(left, right):
22 result = []
23 while left and right:
24 result.append(left.pop(0) if left[0] <= right[0] else right.pop(0))
25 # while left:
26 # result.append(left.pop(0))
27 result.extend(left)
28 result.extend(right)
29 # while right:
30 # result.append(right.pop(0))
31 return result
32
33
34# 希尔

Callers 1

merge_sortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected