A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. In a permutation a1.....an of n distinct integers, an inversion is a pair (ai, aj) such that i < j and ai > aj. What would be the worst case time complexity of the Insertion Sort algorithm, if the inputs are restricted to permutations of 1.....n with at most n inversions?
a. Θ (n^2)
b. Θ (n log n)
c. Θ (n^1.5)
d. Θ (n)
Answer:Θ (n)
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: