def min_heapify(arr, start, simulation, iteration):
<EOL>end = len(arr) - <NUM_LIT:1><EOL>last_parent = (end - start - <NUM_LIT:1>) // <NUM_LIT:2><EOL>for parent in range(last_parent, -<NUM_LIT:1>, -<NUM_LIT:1>):<EOL><INDENT>current_parent = parent<EOL>while current_parent <= last_parent:<EOL><INDENT>child = <NUM_LIT:2> * current_parent + <NUM_LIT:1><EOL>if child + <NUM_LIT:1> <= end - start and arr[child + start] > arr[<EOL>child + <NUM_LIT:1> + start]:<EOL><INDENT>child = child + <NUM_LIT:1><EOL><DEDENT>if arr[child + start] < arr[current_parent + start]:<EOL><INDENT>arr[current_parent + start], arr[child + start] =arr[child + start], arr[current_parent + start]<EOL>current_parent = child<EOL>if simulation:<EOL><INDENT>iteration = iteration + <NUM_LIT:1><EOL>print("<STR_LIT>",iteration,"<STR_LIT::>",*arr)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>return iteration<EOL>
Min heapify helper for min_heap_sort