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

Tracking Reordering #9

Open
diwot opened this issue Sep 14, 2024 · 1 comment
Open

Tracking Reordering #9

diwot opened this issue Sep 14, 2024 · 1 comment

Comments

@diwot
Copy link

diwot commented Sep 14, 2024

Hi, is there a way to track the reordering during the sort process? Some other sort implementations (e. g Array.Sort(...) in the NET framework) allow to provide a key and a value array where the sorting only uses keys for order comparisons. The values can be used to pass in an indexer array with the identity map which then allows to track which element moved where during the sort. I was stumbling over fluxsort (which is a great project by the way) while looking for a faster search algorithm for a project I'm working on where I need to sort 64bit keys and there I need a map to know where each value was located before the sort was applied.

@scandum
Copy link
Owner

scandum commented Sep 16, 2024

I'm not entirely sure what you mean, but maybe the quadsort_size routine in quadsort.h does something similar?

It creates an array of pointers, sorts them, and then copies the values where they belong. Useful when sorting large structures.

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

2 participants