@@ -0,0 +1,1873 @@
+class HashTable:%0A    def __init__(self):%0A        self.size = 11%0A        self.slots = %5BNone%5D * self.size%0A        self.data = %5BNone%5D * self.size%0A%0A    def put(self,key,data):%0A      hashvalue = self.hashfunction(key,len(self.slots))%0A%0A      if self.slots%5Bhashvalue%5D == None:%0A        self.slots%5Bhashvalue%5D = key%0A        self.data%5Bhashvalue%5D = data%0A      else:%0A        if self.slots%5Bhashvalue%5D == key:%0A          self.data%5Bhashvalue%5D = data  #replace%0A        else:%0A          nextslot = self.rehash(hashvalue,len(self.slots))%0A          while self.slots%5Bnextslot%5D != None and %5C%0A                          self.slots%5Bnextslot%5D != key:%0A            nextslot = self.rehash(nextslot,len(self.slots))%0A%0A          if self.slots%5Bnextslot%5D == None:%0A            self.slots%5Bnextslot%5D=key%0A            self.data%5Bnextslot%5D=data%0A          else:%0A            self.data%5Bnextslot%5D = data #replace%0A%0A    def hashfunction(self,key,size):%0A         return key%25size%0A%0A    def rehash(self,oldhash,size):%0A        return (oldhash+1)%25size%0A%0A    def get(self,key):%0A      startslot = self.hashfunction(key,len(self.slots))%0A%0A      data = None%0A      stop = False%0A      found = False%0A      position = startslot%0A      while self.slots%5Bposition%5D != None and  %5C%0A                           not found and not stop:%0A         if self.slots%5Bposition%5D == key:%0A           found = True%0A           data = self.data%5Bposition%5D%0A         else:%0A           position=self.rehash(position,len(self.slots))%0A           if position == startslot:%0A               stop = True%0A      return data%0A%0A    def __getitem__(self,key):%0A        return self.get(key)%0A%0A    def __setitem__(self,key,data):%0A        self.put(key,data)%0A%0AH=HashTable()%0AH%5B54%5D=%22cat%22%0AH%5B26%5D=%22dog%22%0AH%5B93%5D=%22lion%22%0AH%5B17%5D=%22tiger%22%0AH%5B77%5D=%22bird%22%0AH%5B31%5D=%22cow%22%0AH%5B44%5D=%22goat%22%0AH%5B55%5D=%22pig%22%0AH%5B20%5D=%22chicken%22%0Aprint(H.slots)%0Aprint(H.data)%0A%0Aprint(H%5B20%5D)%0A%0Aprint(H%5B17%5D)%0AH%5B20%5D='duck'%0Aprint(H%5B20%5D)%0Aprint(H%5B99%5D)%0A

Create heaps.py