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

Add ability to pass in comparator instead of making keys implement Comparable #41

Open
rnikander opened this issue Aug 22, 2022 · 0 comments

Comments

@rnikander
Copy link

Maybe I'm missing something, but it seems like with some algorithms there is an advantage to passing in the function that does the comparison. As an example, I'm computing line segment intersections with a sweep line algorithm. I wanted to try your BTree or SortedSet because my current data structure (a red black tree) seems slow. But it's difficult to use these classes because I need a comparison function that uses state from the algorithm: the sweep line, current point, etc. I can get around this by adding a reference to every single element in the SortedSet, but they were just integers, so that's at least doubled the storage needed per element.

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