dartz icon indicating copy to clipboard operation
dartz copied to clipboard

Make IHashSet (similar to IHashMap)

Open averynortonsmith opened this issue 4 years ago • 1 comments

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.

averynortonsmith avatar Jul 15 '20 21:07 averynortonsmith

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!

spebbe avatar Jul 18 '20 12:07 spebbe