Insertion Sort Multiple choice Questions and Answers (MCQs)
How many passes does an insertion sort algorithm consist of?
Question 1 Explanation:
An insertion algorithm consists of N-1 passes when an array of N elements is given.
Which of the following algorithm implementations is similar to that of an insertion sort?
Question 2 Explanation:
Insertion sort is similar to that of a binary heap algorithm because of the use of temporary variable to swap.
What is the average case running time of an insertion sort algorithm?
O(N log N)
Question 3 Explanation:
The average case analysis of a tight bound algorithm is mathematically achieved to be O(N2).
Any algorithm that sorts by exchanging adjacent elements require O(N2) on average.
Question 4 Explanation:
Each swap removes only one inversion, so O(N2) swaps are required.
What is the average number of inversions in an array of N distinct numbers?
Question 5 Explanation:
The total number of pairs in a list L is N(N-1)/2. Thus, an average list has half this amount, or N(N-1)/4 inversions.
There are 5 questions to complete.