Recent questions tagged descriptive

0 votes
0 answers
1201
Why do we want the loop index $i$ in line $2$ of BUILD-MAX-HEAP to decrease from $\lfloor A.length/2 \rfloor$ to 1 rather than increase from 1 to $\lfloor A.length/2 \rfl...
0 votes
0 answers
1202
0 votes
0 answers
1205
0 votes
0 answers
1206
0 votes
0 answers
1210
0 votes
0 answers
1211
What is the relationship between the running time of insertion sort and the number of inversions in the input array? Justify your answer.
0 votes
1 answer
1212
0 votes
1 answer
1213
0 votes
1 answer
1215
0 votes
0 answers
1219
1 votes
1 answer
1220
0 votes
1 answer
1221
0 votes
2 answers
1224
0 votes
1 answer
1227
0 votes
1 answer
1228
Using Figure 2.2 as a model, illustrate the operation of INSERTION-SORT on the array $ A =( 31, 41, 59, 26, 41, 58)$
0 votes
0 answers
1229
What is the smallest value of $n$ such that an algorithm whose running time is $100n^2$ runs faster than an algorithm whose running time is $2^n$ on the same machine?