2 ms·
but maps are simpler to use (if appropriately provided by the language). maps/sets are also fundamentally building blocks for a lot of algorthms and structures
by dathinab 5y ago
but maps are simpler to use (if appropriately provided by the language).
maps/sets are also fundamentally building blocks for a lot of algorthms and structures, not having them makes it WAY harder to implement them. actually potential impossible as performance can easily degrade to a point where it's unusable when you use O(n) (or worse) lookups instead of O(1) ones.
this is not a case of premature optimizations but of missing fundamental building blocks
and if you don't want genetics, ok, do it like go did initially make the map special language thingy.