Chapter Review Questions
Which is true for a
Dictionary: is it mutable or immutable?Though for some collections, like arrays and lists, you can fairly easily replace a
foreachloop with aforloop, that is not the case if you want to iterate through aDictionary. How do you go through all the keys in aDictionary?What syntax is there for a
Dictionarythat matches that for aList?How is a
Dictionarylike an array? How is it different?Dictionaryvalues are of arbitrary type. What is the restriction on key types?How is a
HashSetdifferent than aList?What syntax is shared between a
Listand aHashSet?Which is more efficient in general: searching for an element of a list or finding the value given a key in a dictionary?