






"""simple docstring"""





def 							A(    snake_case_		,  snake_case_		,  snake_case_						):
       """simple docstring"""





       lowercase__:							Any         =     index
       lowercase__:							Tuple         =     2 * index + 1
       lowercase__:							Optional[int]         =     2 * index + 2
       if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
              lowercase__:							int         =     left_index

       if right_index < heap_size and unsorted[right_index] > unsorted[largest]:
              lowercase__:							Tuple         =     right_index

       if largest != index:
              lowercase__    ,      lowercase__:							str         =     unsorted[index], unsorted[largest]
              heapify(snake_case_		,  snake_case_		,  snake_case_						)






def 							A(    snake_case_						):
       """simple docstring"""





       lowercase__:							List[Any]         =     len(snake_case_						)
       for i in range(n // 2 - 1		,  -1		,  -1						):
              heapify(snake_case_		,  snake_case_		,  snake_case_						)
       for i in range(n - 1		,  0		,  -1						):
              lowercase__    ,      lowercase__:							List[str]         =     unsorted[i], unsorted[0]
              heapify(snake_case_		,  0		,  snake_case_						)
       return unsorted


if __name__ == "__main__":
  UpperCamelCase					=     input("""Enter numbers separated by a comma:\n""").strip()
  UpperCamelCase					=     [int(item) for item in user_input.split(""",""")]
  print(heap_sort(unsorted))














"""simple docstring"""





import doctest

import projectq
from projectq.ops import H, Measure






def 							A(    snake_case_						):
       """simple docstring"""





       lowercase__:							Dict         =     quantum_engine.allocate_qubit()
       H | qubit
       Measure | qubit
       return int(snake_case_						)


if __name__ == "__main__":
  doctest.testmod()

  # initialises a new quantum backend
  UpperCamelCase					=     projectq.MainEngine()

  # Generate a list of 10 random numbers
  UpperCamelCase					=     [get_random_number(quantum_engine) for _ in range(10)]

  # Flushes the quantum engine from memory
  quantum_engine.flush()

  print("""Random numbers""", random_numbers_list)






