Section 6.13 Search Tree Operations
Before we look at the implementation, let’s review the interface provided by the map ADT. You will notice that this interface is very similar to the Python dictionary.
-
Map()
creates a new empty map. -
put(key, val)
adds a new key–value pair to the map. If the key is already in the map, it replaces the old value with the new value. -
size()
returns the number of key–value pairs stored in the map. -
in
returnTrue
for a statement of the formkey in map
if the given key is in the map,False
otherwise.
You have attempted 1 of 1 activities on this page.