
'''simple docstring'''


from collections import deque

from .hash_table import HashTable

class 		__lowercase (     _lowercase			):

			def __init__(self	,      *A	,      **A					):
								super().__init__(*_snake_case	,      **_snake_case					)

			def 				UpperCAmelCase__       (self	,      A	,      A					):
								lowerCamelCase_    :					List[str]   =						deque([]					) if self.values[key] is None else self.values[key]
								self.values[key].appendleft(_snake_case					)
								lowerCamelCase_    :					Optional[int]   =						self.values[key]

			def 				UpperCAmelCase__       (self					):
								return (
								    sum(self.charge_factor - len(_snake_case					) for slot in self.values					)
								    / self.size_table
								    * self.charge_factor
								)






			def 				UpperCAmelCase__       (self	,      A	,      A=None					):


								if not (
								    len(self.values[key]					) == self.charge_factor and self.values.count(_snake_case					) == 0
								):
													return key
								return super()._collision_resolution(_snake_case	,      _snake_case					)








def    A						(__A   :    list   ,				__A   :    int   ,				__A   :    int = 0   ,				__A   :    int = 0       )   ->      int:







     """simple docstring"""


     UpperCAmelCase_          =							right or len(__A       ) - 1
     if left > right:
          return -1
     elif list_data[left] == key:
          return left
     elif list_data[right] == key:
          return right
     else:
          return search(__A   ,				__A   ,				left + 1   ,				right - 1       )


if __name__ == "__main__":
    import doctest

    doctest.testmod()






