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

It could be better if it is mentioned in the instructions.
So this might be added to the instructions :

“Do not pass in any argument for now and call the function only once.”

Is there a section in the forum that we can suggest updates for the instructions?

that doesn’t work, one should be guided with properly working solution, please.