def setitem (selfkv)"""assign value to key koverwriting existing value if present "" self find index( len(self table if len(self tableand self table[jkey =kreassign value self table[jvalue elseadds new item self table insert(jself item( , )def delitem (selfk)"""remove item associated with key (raise keyerror if not found"" self find index( len(self table if =len(self tableor self table[jkey !kraise keyerrorkey errorrepr( )delete item self table pop(jdef iter (self)"""generate keys of the map ordered from minimum to maximum ""for item in self tableyield item key def reversed (self)"""generate keys of the map ordered from maximum to minimum ""for item in reversed(self table)yield item key def find min(self)"""return (key,valuepair with minimum key (or none if empty""if len(self table return (self table[ keyself table[ valueelsereturn none def find max(self)"""return (key,valuepair with maximum key (or none if empty""if len(self table return (self table[- keyself table[- valueelsereturn none code fragment an implementation of sortedtablemap class (together with code fragments and