+1 vote
in Data Structures & Algorithms II by (110k points)
What is the average case running time of an insertion sort algorithm?

(a) O(N)

(b) O(N log N)

(c) O(log N)

(d) O(N^2)

I had been asked this question at a job interview.

This intriguing question comes from Insertion sort in chapter Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Correct choice is (d) O(N^2)

The best I can explain: The average case analysis of a tight bound algorithm is mathematically achieved to be O(N^2).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.