The procedure operates on three arrays $\text{A} [0 \dots 99], \text{B}[0 \dots 99]$ and $\text{C} [0 \dots 99],$ which are initialized with integer values.
procedure mystery () {
for (i=0; i<100; i++) {C[i] = A[i];}
p=99;
for (i=0; i<100; i++) {
B[p] = C[0];
p = p-1;
for (j=1; j<100; j++){
C[j - 1] = C[j];
}
}
}
When the procedure terminates, which of the following statements can be asserted about the array $\text{C}?$
- It contains the elements of $\text{A}$ sorted in ascending order
- It contains the elements of $\text{A}$ sorted in descending order
- All value are equal to $\text{A}[99]$
- All value are equal to $\text{A}[0]$