Skip to main content

Posts

Showing posts from 2021

Coding solutions - Amazon card, Data structure, Search and Sort

  Amazon card, Data structure, search and sort Hashmap # HASH MAP implementation in python class Node :     def __init__ (self, key, value) :         self.key = key         self.value = value         self.next = None class HashMap :     def __init__ (self) :         self.store = [ None for _ in range( 16 )]     def get (self, key) :         index = hash(key) & 15         if self.store[index] is None :             return None         n = self.store[index]         while True :             if n.key == key:                 return n.value             else :                 if n.next:         ...