Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 3 Dictionary. Lab 3 SortedArray derived from dictionary will be provided sortedChain (interface) derived from dictionary will be provided Students.

Similar presentations


Presentation on theme: "Lab 3 Dictionary. Lab 3 SortedArray derived from dictionary will be provided sortedChain (interface) derived from dictionary will be provided Students."— Presentation transcript:

1 Lab 3 Dictionary

2 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

3 Lab 3 Implement find, insert and erase function for sortedChain Due date: March 22

4 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

5 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

6 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;


Download ppt "Lab 3 Dictionary. Lab 3 SortedArray derived from dictionary will be provided sortedChain (interface) derived from dictionary will be provided Students."

Similar presentations


Ads by Google