Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ mergeSort
Method
mergeSort
python/0912-sort-an-array.py:23–30 ·
view source on GitHub ↗
(arr, l, r)
Source
from the content-addressed store, hash-verified
21
i += 1
22
23
def
mergeSort(arr, l, r):
24
if
l == r:
25
return
arr
26
m = (l + r) // 2
27
mergeSort(arr, l, m)
28
mergeSort(arr, m + 1, r)
29
merge(arr, l, m, r)
30
return
arr
31
32
return
mergeSort(nums, 0, len(nums) - 1)
Callers
nothing calls this directly
Calls
2
mergeSort
Function · 0.85
merge
Function · 0.50
Tested by
no test coverage detected