Morgan Stanley interview question

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

Interview Answers

Anonymous

5 Feb 2018

C++ has std::unordered_map

Anonymous

30 Nov 2012

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

2