4.2 Sorted array

How do we say that an array is sorted in a non-decreasing order? Let us assume that the array is called $a$, and it has $n$ elements.

$\forall i \in [0,n-2]: a_{i} \le a_{i+1}$

Note that $[0,n-2]$ is the set of all integers from 0 to $n-2$, including 0 and $n-2$.



Copyright © 2006-08-28 by Tak Auyeung