In [1]:
from pythonds9.basic.hashtable import HashTable
In [2]:
words = ["aah" ,"aal" ,"aas" ,"aba" ,"abs" ,"aby" ,"ace",
         "act" ,"add" ,"ado" ,"ads" ,"adz" ,"aff" ,"aft" ,
         "aga" ,"age" ,"ago" ,"ags" ,"aha" ,"ahi" ,"ahs" ,"aid" ,
         "ail" ,"aim" ,"ain" ,"air" ,"ais" ,"ait" ,"aji" ,"ala" ,
         "alb" ,"ale" ,"all" ,"alp" ,"als" ,"alt" ,"ama" ,"ami" ,
         "amp" ,"amu" ,"ana" ,"and" ,"ane" ,"ani" ,"ant" ,"any" ,
         "ape" ,"apo" ,"app" ,"apt" ,"arb" ,"arc" ,"are" ,"arf" ,
         "ark" ,"arm" ,"ars" ,"art" ,"ash" ,"ask" ,"asp" ,"ass" ,
         "ate" ,"att" ,"auk" ,"ava" ,"ave" ,"avo" ,"awa" ,"awe" ,
         "awl" ,"awn" ,"axe" ,"aye", "ays"]
print(len(words))
75
In [3]:
ht = HashTable(100)
for i, word in enumerate(words):
    ht.put(word, i)
In [4]:
ht.slots
Out[4]:
[None,
 None,
 None,
 'aah',
 'ala',
 None,
 'age',
 'aff',
 'aid',
 'alb',
 'ama',
 'ana',
 None,
 None,
 None,
 'aal',
 'ale',
 'and',
 None,
 'arb',
 'ahi',
 'ane',
 'arc',
 None,
 'aji',
 'ape',
 'ava',
 'awa',
 'are',
 None,
 'ado',
 'ail',
 'ami',
 'ani',
 'aim',
 'arf',
 'aas',
 'ago',
 'abs',
 'ain',
 'all',
 'ash',
 'ads',
 'act',
 'ate',
 'ave',
 'ark',
 'awe',
 'ags',
 'aft',
 'ahs',
 'air',
 'ais',
 'alp',
 'amp',
 'ait',
 'aby',
 'apo',
 'als',
 'app',
 'arm',
 'alt',
 'ask',
 'adz',
 'asp',
 'ant',
 'amu',
 'auk',
 'avo',
 'apt',
 'ars',
 'awl',
 'ass',
 'art',
 'awn',
 'axe',
 'aye',
 'att',
 None,
 None,
 'any',
 None,
 None,
 None,
 'aba',
 'ays',
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 'aga',
 None,
 'aha',
 'add',
 'ace',
 None]