Ask Question
24 October, 10:42

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?

+1
Answers (1)
  1. 24 October, 11:01
    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 & 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