MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / mergeSortInternal

Function mergeSortInternal

algorithm/algorithm.c:192–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 p += left;
191 right -= left;
192 }
193 else { /* A1 A2 B -> A1 B A2 (A2 is final) */
194 alg_swap_bytes(p + left - right, p + left, right);
195 left -= right;
196 }
197 }
198}
199
200
201/* Uniform random index in [0, bound) from a generator of uniformly random
202 * 32-bit values: rng() % bound, as algorithm_shuffle has always computed it,
203 * except that a draw from the incomplete top range (r >= the largest
204 * multiple of bound that fits in 2^32) is rejected and drawn again - that
205 * tail is what made rng() % bound favour small indices. Accepted draws give
206 * exactly the old index, so the same generator still gives the same

Callers 1

algorithm_stable_sortFunction · 0.85

Calls 1

mergeFunction · 0.85

Tested by

no test coverage detected