Bloomberg LP Interview Question
Software Engineer / Developersmap is a data structure which store <key, value> pair . The standard opeartion for map is :
insert : insert a new pair in map , duplicated key could not be inserted again
lookup: look up specific pair by key fast
delete: delete pairs
Normally, there are 2 ways to implement map:
1 HashMap : use hash table to implement map, which make constant operation time;
2 TreeMap : use balance search tree to implement map, which make logarithmic operation time ( in C++ STL , red-black tree is employed to implement map and set )
So , in this case, i will say " map is a ADT( abstract data type) , wherease hashmap is a implementation of this ADT , besides hashmap, we could also resort to tree to implement map ...... "
Which domain? C++ STL?
- Thomson? July 30, 2010