CS174: Map ADT And STL Maps

Developed by Professor Tralie and Professor Mongan.


Please watch the video below, and click the next button once you have finished

Notes

  • A Map abstract data type is an unordered pairing between "keys" and "values." We look things up by their key, and we get back the associated value
  • We can think of a map in the following ways:
    • A collection of pairs of information, where a value is "glued" or "associated" to a key (in fact, the Perl programming language calls it an "associative array").
    • A dictionary, where you look up some information about a key (in fact, python calls it a "dictionary")
    • A function, where the input is the key and the output is the value. This also highlights the fact that each key can appear at most once (i.e. it passes the "vertical line test").
    • An array with indices that are arbitrary object types. C++, python, and Javascript all use the "syntactic sugar" of using the square brackets [key] to look up a value