MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / swap

Function swap

sorting/quick-sort.js:39–43  ·  view source on GitHub ↗
(i, j, array)

Source from the content-addressed store, hash-verified

37}
38
39function swap(i, j, array) {
40 const temp = array[j];
41 array[j] = array[i];
42 array[i] = temp;
43}
44
45const array = [8, 5, 2, 9, 5, 6, 3];
46console.log(quickSort(array));

Callers 1

quickSortHelperFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected