Ask Question
9 November, 12:41

assume that you want to sort an array have 100000 elements which algorithm (insert sort algorithm or quick sort algorithm) is the best option? why?

+5
Answers (1)
  1. 9 November, 15:27
    0
    Quick Sort.

    Explanation:

    Quick Sort will be best suited for an array having 100000 elements instead of the insertion sort algorithm because as we know the average time complexity of quick sort is O (NlogN) and for insertion sort is O (n^2). The sorting totally depends upon the pivot that is being selected in quick sort.

    While insertion sort is best suited for arrays that are already sorted it takes O (n) time in those cases.

    Since the array that we have is very large and so we need an algorithm that can sort the array faster than the other sorting algorithms. Quick Sort is also inplace and does not requires extra space to do the sorting.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “assume that you want to sort an array have 100000 elements which algorithm (insert sort algorithm or quick sort algorithm) is the best ...” 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