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

Any interest for a splay sort implementation? #201

Closed
carlopi opened this issue Feb 20, 2022 · 2 comments
Closed

Any interest for a splay sort implementation? #201

carlopi opened this issue Feb 20, 2022 · 2 comments

Comments

@carlopi
Copy link

carlopi commented Feb 20, 2022

I could contribute with a somehow decent splay-sort implementation. Basically it works by insert elements one by one in a splay tree + visit of the tree ordering the data.

Main advantage, as with tim-sort, is that's it's adaptive (& stable).
Main drawback is that it requires 2 pointers per element memory overhead.

Not sure whether this could make sense with the approach / scope of this library.

@Morwenn
Copy link
Owner

Morwenn commented Feb 21, 2022

A splaysort certainly falls in the scope of the library, especially since I like interesting adaptive comparison sorts. An implementation would be welcome as long as all tests pass - which I can help with.

Ideally I want to make a separate library for extras and contributions (see #147), but I haven't started the work on it and I'm not working much lately, so you can ignore it and make a PR to the main repository (here) instead.

@carlopi
Copy link
Author

carlopi commented Feb 21, 2022

Perfect, I will have to review the implementation and adapt it, I will ping when I am closer to something ready to be merged.

@carlopi carlopi closed this as completed Feb 21, 2022
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