// Quicksort benchmark - sorting algorithm
function quicksort(arr) {
    if (arr.length <= 1) return arr;
    const pivot = arr[0];
    const rest = arr.slice(1);
    const less = rest.filter(x => x < pivot);
    const greater = rest.filter(x => x >= pivot);
    return [...quicksort(less), pivot, ...quicksort(greater)];
}

// Sort 1000 random-ish numbers
const nums = Array.from({length: 1000}, (_, i) => (i * 7 + 13) % 1000);
const sorted = quicksort(nums);
console.log(`Sorted ${sorted.length} elements`);
