MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / QuickSort

Function QuickSort

assets/js/quicksort.js:128–137  ·  view source on GitHub ↗
(l, r, delay = 100)

Source from the content-addressed store, hash-verified

126
127// Asynchronous QuickSort function
128async function QuickSort(l, r, delay = 100) {
129if (l < r) {
130 // Storing the index of pivot element after partition
131 var pivot_idx = await lometo_partition(l, r);
132 // Recursively calling quicksort for left partition
133 await QuickSort(l, pivot_idx - 1);
134 // Recursively calling quicksort for right partition
135 await QuickSort(pivot_idx + 1, r);
136}
137}
138
139// Calling generatearray function
140generatearray();

Callers

nothing calls this directly

Calls 1

lometo_partitionFunction · 0.85

Tested by

no test coverage detected