Dictionaries
 











 

 

INPUT                                      OUTPUT

 

 

Input Description: A set of n records, each identified by one or more key fields.



Problem: Build and maintain a data structure to efficiently locate, insert, or delete the record associated with any query key q.




An essential piece of advice is to carefully isolate the implementation of the dictionary data structure from its interface. Use explicit calls to subroutines that initialize, search, and modify the data structure, rather than embedding them within the code. This leads to a much cleaner program, but it also makes it easy to try different dictionary implementations to see how they impact performance. Do not obsess about the cost of the procedure call overhead inherent in such an abstraction. If your application is so time-critical that such overhead can impact performance, then it is even more essential that you be able to easily experiment with different implementations of your dictionary.


(c) Shilpa Sayura Foundation 2006-2017