Dictionaries
Dictionaries
Collection of items.
Each item is a pair.
(key, element)
Pairs have different keys.
Operations.
get(Key) ( or, Search(Key))
put(Key, Element) (or, Insert(Key, Element))
remove(Key) (or, Delete(Key))
The word item is used as a synonym for element to avoid the confusion that would otherwise result by saying that a dictionary is a collection of elements and each element is a pair (key, element).
A linear list is an ordered sequence of elements. A dictionary is just a collection of elements/items.
Interface Dictionary has these 3 methods.
|
|