Ask Question

Whats an effective way to sort linked lists in cpp.

+4
Answers (1)
  1. 8 November, 14:33
    0
    Using Merge Sort.

    Explanation:

    Merge Sort is preferred for sorting the linked list because the the data stored in linked list is not in serial memory address which makes the quick sort algorithm very slow and other sorting algorithms impossible.

    Merge Sort is a divide and conquer algorithm.

    In this algorithms we divide the linked list into sub parts and sort the sub parts of the linked list and then we merge them in sorted order. It is a very effective approach for linked list sorting.

    The time complexity of merge sort is O (NLogN).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Whats an effective way to sort linked lists in cpp. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers