+1 vote
in Data Structures & Algorithms II by (110k points)
How many passes does an insertion sort algorithm consist of?

(a) N

(b) N-1

(c) N+1

(d) N^2

This question was addressed to me during an online interview.

The origin of the question is Insertion sort topic in portion Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Correct option is (b) N-1

Best explanation: An insertion algorithm consists of N-1 passes when an array of N elements is given.

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.