MCPcopy Create free account
hub / github.com/careercup/CtCI-6th-Edition-JavaScript / quickSort

Function quickSort

chapter10/sortingAlgos/quickSort.js:31–39  ·  view source on GitHub ↗
(array, left, right)

Source from the content-addressed store, hash-verified

29};
30
31const quickSort = (array, left, right) => {
32 const index = partition(array, left, right);
33 if (left < index - 1) {
34 quickSort(array, left, index - 1);
35 }
36 if (index < right) {
37 quickSort(array, index, right);
38 }
39};
40
41let array = [4, 7, 1, 9, 3, 8, 0, 2];
42quickSort(array, 0, array.length - 1);

Callers 1

quickSort.jsFile · 0.85

Calls 1

partitionFunction · 0.70

Tested by

no test coverage detected