You are viewing a single comment's thread. Return to all comments →
JAVASCRIPT you guys think this is speed optimized??
function countingSort(arr) { const frequencyArray = [] for (let i = 0; i < arr.length; i++) { const current = arr[i] if (current > 99) continue; if (!frequencyArray[i] && i < 100) frequencyArray[i] = 0 if (!frequencyArray[current]) frequencyArray[current] = 0 frequencyArray[current]++; } return frequencyArray }
Counting Sort 1
You are viewing a single comment's thread. Return to all comments →
JAVASCRIPT you guys think this is speed optimized??