1. Learn
  2. /
  3. Courses
  4. /
  5. Data Structures and Algorithms in Python

Exercise

Correcting a bug in the merge sort algorithm

You have been given a program that sorts a list of numbers using the merge sort algorithm. While testing the merge_sort() function, you realize that the code is not correct. Can you correct the algorithm so that it works correctly?

Instructions

100 XP
  • Correct the mistake when assigning the left half.
  • Correct the mistake when assigning the right half.
  • Correct the mistake when updating the pointer for the left half.
  • Correct the mistake when updating the pointer for the right half.