dartz
dartz copied to clipboard
Make IHashSet (similar to IHashMap)
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.
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!