Ask Question
7 February, 12:21

Whats an effective way to sort linked lists in cpp.

+3
Answers (1)
  1. 7 February, 14:11
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers