2 ms·
The Map data structure intrigues me as one of the main reasons I'd use a Map in other languages is for the O(1) access time complexity. I like that the footnote
by nobleach 5y ago
The Map data structure intrigues me as one of the main reasons I'd use a Map in other languages is for the O(1) access time complexity. I like that the footnotes give more insight into how Elixir is implementing these things under the hood.
- kadoban 5y agoO(lg n) bounds are fairly common for maps. C++'s for instance (though it also has unordered_map). The practical difference between O(1) bound and O(lg n) bound typically comes down to the constants anyway, making the big-O pretty much a wash for practical purposes.