ADT that stores key-value pairs
A Dictioary is a generalisation of a Map
Ex:
(5, "A")
(7, "C")
(7, "D")
| Method | What it does |
|---|---|
isEmpty() |
returns true if the map has no entries |
size() |
returns how many key–value pairs exist |
insertItem(Key k, Object o) |
adds a new pair (key, value) |
removeElement(Key k) |
deletes the pair for that key |
findElement(Key k) |
returns the value associated with k, or null if not found |
containsKey(Key k) |
checks if a key exists |
containsValue(Object o) |
checks if a value exists |