Chapter 7: Problem 3
Show that the worst-case and average-case time complexities for the number of assignments of records performed by the Insertion Sort algorithm (Algorithm 7.1) are given by $$W(n)=\frac{(n+4)(n-1)}{2} \approx \frac{n^{2}}{2} \quad \text { and } \quad A(n)=\frac{n(n+7)}{4}-1 \approx \frac{n^{2}}{4}$$
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.