Morgan Stanley interview question

The difference between Java and C++'s implementation of Map

Interview Answers

Anonymous

Feb 5, 2018

C++ has std::unordered_map

Anonymous

Nov 30, 2012

Java uses hash functions to implement an efficient map (with almost linear complexity), while C++ uses binary trees (which give logN complexity).

2