MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / merge

Function merge

sorts/timsort.py:31–41  ·  view source on GitHub ↗
(left, right)

Source from the content-addressed store, hash-verified

29
30
31def merge(left, right):
32 if not left:
33 return right
34
35 if not right:
36 return left
37
38 if left[0] < right[0]:
39 return [left[0]] + merge(left[1:], right)
40
41 return [right[0]] + merge(left, right[1:])
42
43
44def timsort(lst):

Callers 1

timsortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected