🌸April Bloom
TUF
Take U ForwardApril2026
algorithm.jsMerge Sort
// Merge Sort O(n log n) [Apr]
function mergeSort(arr) {
if (arr.length <= 1) return arr;
const mid = arr.length >> 1;
const L = mergeSort(arr.slice(0, mid));
const R = mergeSort(arr.slice(mid));
return merge(L, R);
}
function merge(L, R) {
const res = []; let i = 0, j = 0;
while (i<L.length && j<R.length)
res.push(L[i]<=R[j]?L[i++]:R[j++]);
return [...res,...L.slice(i),...R.slice(j)]; }April 2026
Mon
Tue
Wed
Thu
Fri
Sat
Sun
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
EasyMediumHardNoteVoiceHoliday