





"""simple docstring"""




from .hash_table import HashTable
from .number_theory.prime_numbers import is_prime, next_prime




class 					_a		( _lowerCAmelCase							):






				def __init__(					self						:       Tuple,					*lowerCAmelCase__						:       Tuple,					**lowerCAmelCase__						:       Optional[int]				)      -> Union[str, Any]:




										'''simple docstring'''



										super().__init__(*lowerCAmelCase__,					**lowerCAmelCase__				)






				def 							snake_case      (					self						:       Any,					lowerCAmelCase__						:       Dict,					lowerCAmelCase__						:       Tuple				)      -> Optional[Any]:




										'''simple docstring'''



										_UpperCamelCase     :   Tuple      =       (
										    next_prime(value % self.size_table				)
										    if not is_prime(value % self.size_table				)
										    else value % self.size_table
										)  # gt = bigger than
										return next_prime_gt - (data % next_prime_gt)






				def 							snake_case      (					self						:       int,					lowerCAmelCase__						:       Any,					lowerCAmelCase__						:       List[Any],					lowerCAmelCase__						:       Tuple				)      -> Any:




										'''simple docstring'''



										return (increment * self.__hash_function_a(lowerCAmelCase__,					lowerCAmelCase__				)) % self.size_table






				def 							snake_case      (					self						:       Dict,					lowerCAmelCase__						:       str,					lowerCAmelCase__						:       Optional[Any]=None				)      -> Union[str, Any]:




										'''simple docstring'''



										_UpperCamelCase     :   Tuple      =       1
										_UpperCamelCase     :   Dict      =       self.hash_function(lowerCAmelCase__				)

										while self.values[new_key] is not None and self.values[new_key] != key:
																_UpperCamelCase     :   Optional[int]      =       (
																    self.__hash_double_function(lowerCAmelCase__,					lowerCAmelCase__,					lowerCAmelCase__				)
																    if self.balanced_factor() >= self.lim_charge
																    else None
																)
																if new_key is None:
																						break
																else:
																						i += 1

										return new_key










"""simple docstring"""




from .hash_table import HashTable
from .number_theory.prime_numbers import is_prime, next_prime




class 					_a		( _lowerCAmelCase							):






				def __init__(					self						:       Tuple,					*lowerCAmelCase__						:       Tuple,					**lowerCAmelCase__						:       Optional[int]				)      -> Union[str, Any]:




										'''simple docstring'''



										super().__init__(*lowerCAmelCase__,					**lowerCAmelCase__				)






				def 							snake_case      (					self						:       Any,					lowerCAmelCase__						:       Dict,					lowerCAmelCase__						:       Tuple				)      -> Optional[Any]:




										'''simple docstring'''



										_UpperCamelCase     :   Tuple      =       (
										    next_prime(value % self.size_table				)
										    if not is_prime(value % self.size_table				)
										    else value % self.size_table
										)  # gt = bigger than
										return next_prime_gt - (data % next_prime_gt)






				def 							snake_case      (					self						:       int,					lowerCAmelCase__						:       Any,					lowerCAmelCase__						:       List[Any],					lowerCAmelCase__						:       Tuple				)      -> Any:




										'''simple docstring'''



										return (increment * self.__hash_function_a(lowerCAmelCase__,					lowerCAmelCase__				)) % self.size_table






				def 							snake_case      (					self						:       Dict,					lowerCAmelCase__						:       str,					lowerCAmelCase__						:       Optional[Any]=None				)      -> Union[str, Any]:




										'''simple docstring'''



										_UpperCamelCase     :   Tuple      =       1
										_UpperCamelCase     :   Dict      =       self.hash_function(lowerCAmelCase__				)

										while self.values[new_key] is not None and self.values[new_key] != key:
																_UpperCamelCase     :   Optional[int]      =       (
																    self.__hash_double_function(lowerCAmelCase__,					lowerCAmelCase__,					lowerCAmelCase__				)
																    if self.balanced_factor() >= self.lim_charge
																    else None
																)
																if new_key is None:
																						break
																else:
																						i += 1

										return new_key



