Ask Question
8 April, 12:51

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?

+2
Answers (1)
  1. 8 April, 13:24
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers