Implement a map in PYTHON using a sorted list of entries. Youshould keep the entry list sorted by key at alltimes, and make use of the binary search routine included in thescaffold to speed up key lookups. The binary search function is : def binary_search(self,key):
min = 0
max = len(self._entries)
while min
mid = int((max + min)/2)
mid_key = self._entries[mid].get_key()
if mid_key == key:
return mid
elif mid_key
min = mid + 1
else:
max = mid
# not found
return -1 the functions we need to implement using this are: containsKey(k) : Returns true if there exists an entry with key k in the map,false otherwise. get(k) : If the map contains an entry with key k and value v, returnsv. Otherwise returns null. put(k, v) : Inserts an item with with key k and value v; if there isalready an item with key k, then replaces its value with v. remove(k) : If the map contains an entry with key k and value v, removessaid entry and returns v. Otherwise returns null. You can’t use the built-in Python functions . . .

"Get 15% discount on your first 3 orders with us"
Use the following coupon
"FIRST15"

Order Now