3 ms·
of the data structures you mentioned, which are easier to work with? to implement? I code in Java and I usually use hashmaps as a go to. they're simple and fast
by dajohnson89 7y ago
of the data structures you mentioned, which are easier to work with? to implement? I code in Java and I usually use hashmaps as a go to. they're simple and fast ways to store relationships between data.
- garmaine 7y agostd::map in C++ is way easier to work with than std::unordered_map (which didn't even exist until C++11).
- yuushi 7y agoDefine "way easier". The interface, at least for day to day operations, is basically identical.
- garmaine 7y agoSupports more features like ordered traversal, generally faster in most cases (yup!), consistent api cost, doesn’t invalidate iterators on certain operations like moving between maps. That’s just off the top of my head.