I have found this code in the internet and it was for arrays ,I want to change it for doubly linked list(instead of index we should use pointer) would you please help me tha
Another idea is to create an array with all the elements of the list, sort the array and then insert the elements to the list again.
Pro: very simple to implement, faster if poor implementation of list mergesort (maybe also faster than good implementations)
Contra: uses some extra space (O(n))