Using the ADT dictionary operations, write pseudocode for a replacefunctionat the client level that replaces the dictionary entry whose search key is x with another entry whose search key is also x.

What will be an ideal response?

```
//Replaces in the dictionary aDictionarythe item whose search key matchessearchKey
//withreplacementItem, whose search key also matches searchKey.
//If the operation is successful, returns true, otherwise returns false.
replace(aDictionary: Dictionary, searchKey:KeyType,
replacementItem: ItemType): boolean
{
result = aDictionary.remove(searchKey)
if (result)
result = aDictionary.add(searchKey, replacementItem)
return result
}

```

Computer Science & Information Technology

You might also like to view...

________ allows a user to decide if a document that was downloaded from the Internet is safe before working with it

A) Protected View B) Print Preview C) Page Layout view D) Live Preview

Computer Science & Information Technology

The ________ data type inserts a unique, numeric value when a new record is entered

A) Currency B) Number C) AutoNumber D) Calculated

Computer Science & Information Technology