# 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/queue.py
# class Queue(object):
#     """ Queue interface
#     
#     """
# 
#     __metaclass__ = ABCMeta
# 
#     @abstractmethod
#     def enqueue(self, item):
#         pass
# 
#     @abstractmethod
#     def dequeue(self):
#         pass
# 
#     @abstractmethod
#     def is_empty(self):
#         pass
# 
#     @abstractmethod
#     def size(self):
#         pass
# 
#     @staticmethod
#     def create():
#         return LinkedListQueue()
# 
#     @abstractmethod
#     def iterate(self):
#         pass


from abc import ABCMeta, abstractmethod
from pyalgs.algorithms.commons import util
from pyalgs.data_structures.commons.queue import Queue
        while x is not None:
            if util.cmp(x.key, key) == 0:
                return True
            x = x.next_node
        return False

    def delete(self, key):
        i = self.hash(key)
        x = self.id[i]
        prev_node = None
        while x is not None:
            if util.cmp(x.key, key) == 0:
                next_node = x.next_node
                self.N -= 1
                if prev_node is not None:
                    prev_node.next_node = next_node
                if self.id[i] == x:
                    self.id[i] = None
                return True
            prev_node = x
            x = x.next_node
        return False

    def add(self, key):
        if key is None:
            raise ValueError('key cannot be None')

        i = self.hash(key)
        x = self.id[i]
        while x is not None:

# 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/queue.py
# class Queue(object):
#     """ Queue interface
#     
#     """
# 
#     __metaclass__ = ABCMeta
# 
#     @abstractmethod
#     def enqueue(self, item):
#         pass
# 
#     @abstractmethod
#     def dequeue(self):
#         pass
# 
#     @abstractmethod
#     def is_empty(self):
#         pass
# 
#     @abstractmethod
#     def size(self):
#         pass
# 
#     @staticmethod
#     def create():
#         return LinkedListQueue()
# 
#     @abstractmethod
#     def iterate(self):
#         pass


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

        while x is not None:
            if util.cmp(x.key, key) == 0:
                return True
            x = x.next_node
        return False

    def delete(self, key):
        i = self.hash(key)
        x = self.id[i]
        prev_node = None
        while x is not None:
            if util.cmp(x.key, key) == 0:
                next_node = x.next_node
                self.N -= 1
                if prev_node is not None:
                    prev_node.next_node = next_node
                if self.id[i] == x:
                    self.id[i] = None
                return True
            prev_node = x
            x = x.next_node
        return False

    def add(self, key):
        if key is None:
            raise ValueError('key cannot be None')

        i = self.hash(key)
        x = self.id[i]
        while x is not None:

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