Learn
Let’s update our merge_sort()
function so that it returns a sorted list finally!
Instructions
1.
In merge_sort()
create two new variables: left_sorted
and right_sorted
.
left_sorted
should be the result of calling merge_sort()
recursively on left_split
.
right_sorted
should be the result of calling merge_sort()
recursively on right_split
.
2.
Erase the “return” line and change it to return the result of calling merge()
on left_sorted
and right_sorted
.
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.