Lab 3 Dictionary
Lab 3 SortedArray derived from dictionary will be provided sortedChain (interface) derived from dictionary will be provided Students will be asked to implement the member functions of sortedChain. Test program will be provided
Lab 3 Implement find, insert and erase function for sortedChain Due date: March 22
Find() template pair * sortedChain ::find(const K& theKey) const {} Return pointer to matching pair, return null if no matching pair. Start from firstNode, check if the node.first == theKey If find the matching pair, return the point, Else return null
Insert() template void sortedChain ::insert(const pair & thePair) {} If exists a pair with same key, update its value If no pair with same key, find the right position for the current pair and insert it into the dictionary Increase the dSize
Erase() template void sortedChain ::erase(const K& theKey) {} Delete the pair whose key equals theKey Find the pair whose key equals theKey, then delete it Descrease dSize;