Summary: Sorting Page 1
Internal sort done totally in main memory.
External uses auxiliary storage (disk).
Stable retains original order if keys are the same. In asking if a sort is stable, we are
asking can it be reasonably coded to be stable.
Adaptive (Non-Oblivious) takes advantage of existing order to do less work.
Sort by address uses indirect addressing so the record (structure) doesn't have to be
Inversion a pair of elements that is out of order. Important in determining a lower
bound. The number of pairs of elements is
(n ways to pick first, n-1 ways to
pick the second, divide by two as order isn't important). On average, only half of these
pairs are out of order, so number of inversions is