retagged by
3,673 views
0 votes
0 votes

Which of the following sorting algorithms has/have minimum running time complexity in best case?

I. Selection Sort

II. Insertion Sort


a. I

b. II

c. Both have same minimum running time complexity

retagged by

2 Answers

1 votes
1 votes
Insertion sort has  minimum running time complexity O(n) in best case i.e when the array is already sorted.

Worst case time complexity of insertion sort =O($n^{2}$ )and selection sort is also O($n^{2}$)

Ans:B)

Related questions

0 votes
0 votes
1 answer
2
LavTheRawkstar asked Jan 12, 2017
809 views
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i 0 and A[i] key) { A[...
1 votes
1 votes
2 answers
3
vishal chugh asked Jan 24, 2018
1,735 views
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
1 votes
1 votes
1 answer
4
rahuldb asked May 7, 2017
12,233 views
Derive the best and worst case complexity of insertion sort algorithm?