错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Dictionaries and Sets

  • Charles Edge,
  • Joel Rennich,
  • Jeremy Bannister

摘要

Dictionaries and sets are two of the most commonly used collection types. They are both unordered collections, but have different strengths and weaknesses. Dictionaries are used to store key-value pairs. The keys are unique identifiers, and the values can be of any type. Dictionaries are a good choice when you need to be able to look up values by their keys. For example, you might use a dictionary to store a mapping of names to addresses.