Solution: Sorting Algorithms
Review the solution that implements an updated version of the merge-sort algorithm.
We'll cover the following
Task
Implement a version of the merge-sort algorithm that sorts a DLList
without using an auxiliary array.
Solution
The given code defines a MergeSortDLL
class that represents a doubly linked list and provides an updated mergeSort()
method to sort the list using the merge-sort algorithm. The add()
method is used to add elements to the doubly-linked list.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy