# Path: pyalgs/algorithms/commons/util.py
# def less(a, b):
# def greater(a, b):
# def cmp(a, b):
# def exchange(a, i, j):
# def is_sorted(a):


from abc import ABCMeta, abstractmethod
from pyalgs.algorithms.commons import util
            if x is None:
                return None
            if util.cmp(key, x.key) == 0:
                return x.value

    def delete(self, key):
        i = self.hash(key)
        for j in range(self.M):
            k = (i + j) % self.M
            x = self.id[k]
            if x is None:
                return None
            if util.cmp(key, x.key) == 0:
                self.id[k] = None
                self.N -= 1
                if self.N == self.M // 4:
                    self.resize(self.M // 2)
                return x.value

    def put(self, key, value):
        i = self.hash(key)
        for j in range(self.M):
            k = (i + j) % self.M
            x = self.id[k]
            if x is None:
                self.id[k] = Node(key, value)
                self.N += 1
                if self.N == self.M // 2:
                    self.resize(self.M * 2)
                break

# Path: pyalgs/algorithms/commons/util.py
# def less(a, b):
# def greater(a, b):
# def cmp(a, b):
# def exchange(a, i, j):
# def is_sorted(a):


# Path: pyalgs/data_structures/commons/hashed_map.py
from abc import ABCMeta, abstractmethod
from pyalgs.algorithms.commons import util

            if x is None:
                return None
            if util.cmp(key, x.key) == 0:
                return x.value

    def delete(self, key):
        i = self.hash(key)
        for j in range(self.M):
            k = (i + j) % self.M
            x = self.id[k]
            if x is None:
                return None
            if util.cmp(key, x.key) == 0:
                self.id[k] = None
                self.N -= 1
                if self.N == self.M // 4:
                    self.resize(self.M // 2)
                return x.value

    def put(self, key, value):
        i = self.hash(key)
        for j in range(self.M):
            k = (i + j) % self.M
            x = self.id[k]
            if x is None:
                self.id[k] = Node(key, value)
                self.N += 1
                if self.N == self.M // 2:
                    self.resize(self.M * 2)
                break

            if util.cmp(x.key, key) == 0: