

"""simple docstring"""




def 		A    (       snake_case__      ):




			'''simple docstring'''


			SCREAMING_SNAKE_CASE__									= len(snake_case__      )

			# Set the gap value to be decreased by a factor of 1.3
			# after each iteration
			SCREAMING_SNAKE_CASE__									= 1.3

			# Continue sorting until the gap is 1
			while gap > 1:
						# Decrease the gap value
						SCREAMING_SNAKE_CASE__									= int(gap / shrink      )

						# Sort the elements using insertion sort
						for i in range(snake_case__						,			len(snake_case__      )      ):
									SCREAMING_SNAKE_CASE__									= collection[i]
									SCREAMING_SNAKE_CASE__									= i
									while j >= gap and collection[j - gap] > temp:
												SCREAMING_SNAKE_CASE__									= collection[j - gap]
												j -= gap
									SCREAMING_SNAKE_CASE__									= temp

			return collection


if __name__ == "__main__":
						import doctest

						doctest.testmod()





"""simple docstring"""




from .hash_table import HashTable





class 				lowerCamelCase  (A__     ):

			def __init__(   self			:  List[str]      ,			*__UpperCAmelCase			:  Union[str, Any]      ,			**__UpperCAmelCase			:  Any    )				->      Optional[int]:
						super().__init__(*__UpperCAmelCase      ,			**__UpperCAmelCase    )





			def    SCREAMING_SNAKE_CASE			(   self			:  List[str]      ,			__UpperCAmelCase			:  int      ,			__UpperCAmelCase			:  Union[str, Any]=None    )				->      Optional[int]:
						SCREAMING_SNAKE_CASE__									= 1
						SCREAMING_SNAKE_CASE__									= self.hash_function(key + i * i    )

						while self.values[new_key] is not None and self.values[new_key] != key:
									i += 1
									SCREAMING_SNAKE_CASE__									= (
									    self.hash_function(key + i * i    )
									    if not self.balanced_factor() >= self.lim_charge
									    else None
									)

									if new_key is None:
												break

						return new_key


