


'''simple docstring'''



class 							__UpperCamelCase       :




	def __init__(     self							):

						'''simple docstring'''





						__a    : Optional[int]      					=						[0]
						__a    : str      					=						0




	def    __UpperCAmelCase							(     self		,       __a							):

						'''simple docstring'''





						__a    : Optional[int]      					=						self.__heap[i]
						while i // 2 > 0:
											if self.__heap[i] > self.__heap[i // 2]:
																__a    : Optional[Any]      					=						self.__heap[i // 2]
																__a    : str      					=						temporary
											i //= 2




	def    __UpperCAmelCase							(     self		,       __a							):

						'''simple docstring'''





						self.__heap.append(__a							)
						self.__size += 1
						self.__swap_up(self.__size							)




	def    __UpperCAmelCase							(     self		,       __a							):

						'''simple docstring'''





						while self.__size >= 2 * i:
											if 2 * i + 1 > self.__size:
																__a    : List[Any]      					=						2 * i
											else:
																if self.__heap[2 * i] > self.__heap[2 * i + 1]:
																					__a    : List[Any]      					=						2 * i
																else:
																					__a    : Tuple      					=						2 * i + 1
											__a    : List[Any]      					=						self.__heap[i]
											if self.__heap[i] < self.__heap[bigger_child]:
																__a    : Optional[Any]      					=						self.__heap[bigger_child]
																__a    : Any      					=						temporary
											__a    : str      					=						bigger_child




	def    __UpperCAmelCase							(     self							):

						'''simple docstring'''





						__a    : List[Any]      					=						self.__heap[1]
						__a    : Union[str, Any]      					=						self.__heap[self.__size]
						self.__size -= 1
						self.__heap.pop()
						self.__swap_down(1							)
						return max_value




	@property
	def    __UpperCAmelCase							(     self							):

						'''simple docstring'''





						return self.__heap[1:]





	def __len__(     self							):

						'''simple docstring'''





						return self.__size


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	# create an instance of BinaryHeap
	__lowercase			:		Dict =			BinaryHeap()
	binary_heap.insert(6)
	binary_heap.insert(10)
	binary_heap.insert(15)
	binary_heap.insert(12)
	# pop root(max-values because it is max heap)
	print(binary_heap.pop())  # 15
	print(binary_heap.pop())  # 12
	# get the list and size after operations
	print(binary_heap.get_list)
	print(len(binary_heap))







'''simple docstring'''



def 						lowerCamelCase							(_SCREAMING_SNAKE_CASE   :     set		,   _SCREAMING_SNAKE_CASE   :     set     ):
					assert isinstance(_SCREAMING_SNAKE_CASE		,   _SCREAMING_SNAKE_CASE     ), F"""The input value of [set_a={set_a}] is not a set"""
					assert isinstance(_SCREAMING_SNAKE_CASE		,   _SCREAMING_SNAKE_CASE     ), F"""The input value of [set_b={set_b}] is not a set"""

					return {a + b for a in set_a for b in set_b}


if __name__ == "__main__":
	from doctest import testmod

	testmod()



