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

Make IHashSet (similar to IHashMap) #53

Open
averynortonsmith opened this issue Jul 15, 2020 · 1 comment
Open

Make IHashSet (similar to IHashMap) #53

averynortonsmith opened this issue Jul 15, 2020 · 1 comment

Comments

@averynortonsmith
Copy link

IHashMap provides a simple interface for creating a map using hash functions for ordering elements. A similar class for sets with hash-ordered elements would be useful as well. How difficult would this be to add? Any tips on how to do it?

Thanks for the library by the way! It's currently powering Pointless.

@spebbe
Copy link
Owner

spebbe commented Jul 18, 2020

Hi – sounds perfectly doable! The resulting structure would most likely be less efficient than ISet, similar to how IHashMap has more overhead than IMap. In the simplest case, one could simply treat IHashMap<K, Unit> as a set structure, i guess? Basing it directly on AVLTree would be more efficient though. I can take a stab at it if you feel it would be a useful data structure?

Pointless looks cool! Always fun to hear about projects using dartz – I'll definitely try it out!

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