Beyond Adjacency

Note that the definition is given in terms of adjacent elements only.

However, we can make the following inference.

Lemma: If B is sorted, $1 \le i \le j \le n$ implies $B[i] \le
B[j]$.

That means that every object to the left of B[j] is smaller than B[j] (not just the adjacent one).

How would you prove this?


next up previous
Next: Keys Up: SORTING Previous: Permutations