Scientific Programming II

ModSim

Maps


In computer science, an associative array/dictionary/Map is a data structure represented by a collection of key/value pairs. Arrays, like int[] or String[] can be thought of as a Map with only increasing integer keys. Maps are very widely used in the real world, such as associating a username with a password or an ID number with a database entry.

According to Wikipedia,

The operations that are usually defined for an associative array are:

We will explore a simple implementation of a Map, which while not very efficient, is very easy to understand and implement. It should have the following methods at minimum: