Unimodal Table API Semantics
- Unimodal: No key may appear more than once in the table
- Insert(k,d):
- If k is in the table, Insert(k,d) overwrites stored data with d
size remains the same
- If k is not in table, Insert(k,d) inserts pair (k,d) in table
size increased by 1
- Retrieve(k,&d):
- If k is in the table, Retrieve(k,&d) sets d to reference the data stored
with k
returns true
- If k is not in table, Retrieve(k,&d) does not modify d
returns false
- Remove(k):
- If k is in the table, Remove(k) removes pair (k,data) from table
size decreased by 1
returns true
- If k is not in table, Remove(k) does not modify table
size is unchanged
returns false
- Iterator i = Includes(k):
- i points to pair (k,d) if k is in table
- i == End() if k is not in table
- Size() returns the number of (key,data) pairs in the table
|