def METHOD_NAME(self, current_idx, end_idx):
    child_one_idx = current_idx * 2 + 1  # Calculate the index of the first child
    while child_one_idx <= end_idx:
        child_two_idx = -1  # Initialize the index of the second child
        if current_idx * 2 + 2 <= end_idx:
            child_two_idx = current_idx * 2 + 2  # Calculate the index of the second child if it exists
        index_to_swap = child_one_idx  # Assume the first child is the one to swap with
        if child_two_idx > -1 and self.heap[child_one_idx] > self.heap[child_two_idx]:
            # If the second child exists and is smaller, update the index to swap with
            index_to_swap = child_two_idx
        if self.heap[current_idx] > self.heap[index_to_swap]:
            # If the current element is greater than the one to swap with, perform the swap
            self.swap(current_idx, index_to_swap)
            current_idx = index_to_swap
            child_one_idx = current_idx * 2 + 1  # Update the index of the first child
        else:
            return