Performance of rank
Assume n = a.length = r.length;
Space:
Assume 1 unit of storage for each array element
(but note that rank does not allocate these arrays.)
Space = c + 2 * n
Time:
Assume we count “object” comparisons only.
Time = n * (n - 1) / 2
Previous slide
Next slide
Back to first slide
View graphic version