In Cormen theorem 3.1 says that
For example, the best case running time of insertion sort is big-omega(n),
There is no contradiction here. The question only states to prove that Big-Theta(g(n))
is asymptotically tightly bound by Big-O(g(n))
and Big-Omega(g(n))
. If you prove the question, you only prove that a function runs in Big-Theta(g(n))
if and only if it runs between Big-O(g(n))
and Big-Omega(g(n))
.
The insertion sort runs from Big-Omega(n)
to Big-Oh(n^2)
, so the running time of insertion sort CANNOT be tightly bound to Big-Theta(n^2)
.
As a matter of fact, CLRS never uses Big-Theta(n^2)
to tightly bound insertion sort.