Exercise: Sorting Algorithms

Solve a task implementing an updated version of the merge-sort algorithm.

We'll cover the following


Implement a version of the merge-sort algorithm that sorts a DLList without using an auxiliary array.

Sample input

The sample input will be as follows:

5 2 9 1 3 6

Expected output

The expected output will be as follows:

Original List: 5 2 9 1 3 6 
Sorted List: 1 2 3 5 6 9 

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy