Java Reference
In-Depth Information
n
3
+2n
j.
n
2
+0.75
Exercise R14.4. We determined that the actual number of visits in the
selection sort algorithm is
1
n
2
5
2
T(n) =
+
n ɨ3
2
659
660
We characterized this method as having O(n
2
) growth. Compute the actual
ratios
T(2,000) /T(1,000)
T(4,000) /T(1,000)
T(10,000) /T(1,000)
and compare them with
f(2,000) /f(1,000)
f(4,000) /f(1,000)
f(10,000) /f(1,000)