How key equality changes the result

A test registry maps string keys to integer counts of available spaces. Apply the seven operations in the figure to an initially empty map, separately under each policy:

  • Exact policy: keys are equal only when every character, including capitalization, matches.
  • Ignore-case policy: capitalization is ignored when comparing keys.

The key text inside each operation is the string supplied to the map. Under both policies, putting an equal existing key replaces its value; removing an absent key changes nothing.


For each policy, report the final number of entries and the sum of the stored space counts. Count a stored value once per entry, even when several entries have equal values. Give all four answers as integers, to zero decimal places.


Seven map operations are arranged from top to bottom.


Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Map ADT Questions: