Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize base case size. #59

Open
make-github-pseudonymous-again opened this issue Oct 2, 2020 · 0 comments
Open

Parameterize base case size. #59

make-github-pseudonymous-again opened this issue Oct 2, 2020 · 0 comments

Comments

@make-github-pseudonymous-again
Copy link
Collaborator

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)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant