presumably the array is made somewhat larger than the current number of employeesto allow room for expansionbut not much expansion is anticipated not always so orderly the speed and simplicity of data access using this array-based database make it very attractive howeverit works in our example only because the keys are unusually well organized they run sequentially from to known maximumand this maximum is reasonable size for an array there are no deletionsso memory-wasting gaps don' develop in the sequence new items can be added sequentially at the end of the arrayand the array doesn' need to be very much larger than the current number of items dictionary in many situations the keys are not so well behaved as in the employee database just described the classic example is dictionary if you want to put every word of an english-language dictionaryfrom to zyzzyva (yesit' word)into your computer' memoryso they can be accessed quicklya hash table is good choice similar widely used application for hash tables is in computer-language compilerswhich maintain symbol table in hash table the symbol table holds all the variable and function names made up by the programmeralong with the addresses where they can be found in memory the program needs to access these names very quicklyso hash table is the preferred data structure let' say we want to store , -word english-language dictionary in main memory you would like every word to occupy its own cell in , -cell arrayso you can access the word using an index number this will make access very fast but what' the relationship of these index numbers to the wordsgiven the word morphosisfor examplehow do we find its index numberconverting words to numbers what we need is system for turning word into an appropriate index number to beginwe know that computers use various schemes for representing individual characters as numbers one such scheme is the ascii codein which is is and so onup to for howeverthe ascii code runs from to to accommodate capitalspunctuationand so on there are really only letters in english wordsso let' devise our own code-- simpler one that can potentially save memory space let' say is is is and so on up to for we'll also say blank is so we have characters (uppercase letters aren' used in this dictionary how do we combine the digits from individual letters into number that represents an entire wordthere are all sorts of approaches we'll look at two representative onesand their advantages and disadvantages add the digits simple approach to converting word to number might be to simply add the code numbers for each character say we want to convert the word cats to number first we convert the characters to digits using our homemade codec