Line 9 will be executed at least k times, because:

```
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. C[ i ] is k or greater, on average
B. lines 10-11 must be executed at least k times, or the algorithm would not work
C. the for loop on line 8 iterates k + 1 times
D. C[ i ] is never less than k


C

Computer Science & Information Technology

You might also like to view...

A class consists of two sections of code -- the _________ section and the ______ section.

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

Computer Science & Information Technology

The World Wide Web is a subset of the Internet that exchanges pages written in HTML

Indicate whether the statement is true or false

Computer Science & Information Technology

A navigation form is useful when you want to provide a(n) ________ of options: navigation tabs and sub-navigation options

Fill in the blank(s) with correct word

Computer Science & Information Technology

The table or tables from which a query gets its data are referred to as the query's data ________

Fill in the blank(s) with correct word

Computer Science & Information Technology