Learn Data Structures by Building the Merge Sort Algorithm - Step 6

Tell us what’s happening:

My code wont pass eventhough the indentation seems okay to me. Could someone please help?
I get the error: You should call merge_sort at the bottom of your function body

Your code so far


# User Editable Region

def merge_sort(array):
    middle_point = len(array) // 2
    left_part = array[:middle_point]
    right_part = array[middle_point:]
    merge_sort(left_part)
    merge_sort(right_part)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Data Structures by Building the Merge Sort Algorithm - Step 6

simply call function merge_sort() no need to pass arguments. call only once.

Omg Thankyou!! this was confusing

1 Like