MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / merge_sort

Function merge_sort

Basics/Merge Sort.cpp:17–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16vector<int> a;
17vector<int> merge_sort(int l, int r) {
18 if (l == r) return {a[l]};
19 int mid = l + r >> 1;
20 vector<int> left = merge_sort(l, mid);
21 vector<int> right = merge_sort(mid + 1, r);
22 return merge(left, right);
23}
24
25int32_t main() {
26 ios_base::sync_with_stdio(0);

Callers 1

mainFunction · 0.85

Calls 1

mergeFunction · 0.70

Tested by

no test coverage detected