Can map contain duplicate keys?



Can map contain duplicate keys?..

Answer / Mange Ram

It depends on the programming language. In some languages like Python, JavaScript, and C++, maps (or dictionaries) can contain duplicate keys with multiple associated values. However, in other languages like Java and Swift, maps only allow unique keys.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

in tree construction which is the suitable efficient data structure? (Array, linked list, stack, queue)

1 Answers  


What is difference between list and linked list?

1 Answers  


What is data and data types?

1 Answers  


What is a hash index?

1 Answers  


Why sorting is used?

1 Answers  


On clicking a node in a tree, all the adjacent edges are turned on. Calculate min of clicks such that all the edges are turned on.

1 Answers   Aspiring Minds,


What is the difference between list, set and map?

1 Answers  


Write code for reversing a linked list.

1 Answers  


What is the use of treemap?

1 Answers  


How many null values are allowed in a set?

1 Answers  


What are the different types of data type?

1 Answers  


What is stack in data structure with the example?

1 Answers  


Categories