Skip to content

Parameterize base case size. #59

@make-github-pseudonymous-again

Description

Currently hard-coded to < 2. Would allow to combine with insertion sort for base case with a single additional function call:

const quickSort = dualtco( yaroslavskiy , k );

const unstableSort = (compare, a, i, j) => {
    shuffle(a, i, j);
    quickSort(compare, a, i, j); // O(N log(N/k))
    insertionSort(compare, a, i, j); // O(kN)
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions