Why can we write over the elements in array A on lines 8-11, without losing the values of the elements in array A?

```
1 COUNTING-SORT( A )
2 make an Array C of length k + 1
3 for each i, from 0 to k
4 C[ i ] = 0
5 for each j, from 0 to the length of A - 1
6 C[ A[ j ] ]++
7 j = 0
8 for each i from 0 to k
9 for each m from 1 to C[ i ]
10 A[ j ] = i
11 j++
```
A. By the time line 8 is reached, all of the information in array A is contained in array C.
B. They are written in array A in such a way that we don’t write into an element of array A until it already has been written in a safe place of array A.
C. Both A and B
D. Neither A nor B


A

Computer Science & Information Technology

You might also like to view...

Assuming that strict two-phase locking is in use, describe how the actions of the two-phase commit protocol relate to the concurrency control actions of each individual server. How does distributed deadlock detection fit in?

What will be an ideal response?

Computer Science & Information Technology

The Pmt function returns the monthly payment due on a loan

Indicate whether the statement is true or false

Computer Science & Information Technology

The Relationships window shows how well the data has been ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

During which of these steps in a training session should a trainer cover what trainees will achieve by the end of the training and why the training is useful?

A. Introduce new topics B. Establish motivation C. Present new material D. Introduce the trainer

Computer Science & Information Technology