Question: For the average case of Insertion Sort we assumed that because a list can have at minimum 0 inversions and at maximum C ( n
For the average case of Insertion Sort we assumed that because a list can have at minimum
inversions and at maximum Cn inversions then we can conclude that an average list
has Cn inversions. This is a somewhat hasty conclusion with weak evidence. Lets
investigate this in more detail. In what follows assume a list of length n contains the values
through n
a Suppose a list A has exactly k inversions. If A is the reversed version of A explain why pts
A has exactly Cn k inversions.
Solution:
b Looking at all possible lists of length n explain why the average number of inversions is pts
actually Cn
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
