❧

Exercises

2.1. Which of the algorithms given by Programs 2.1 through 2.6, 2.8, 2.10, and

display

2.2. Would Program 2.2 still work correctly if /< r were replaced by / <r in

display
122
display

2.3. Program and measure the execution time of the three straight sorting methods

display

2.4. Test the Heapsort Program 2.8 with various random input sequences and

display

2.6. Write a program that combines the Quicksort and Bubblesort algorithms

display

2.7. Perform the same experiment as in Exercise 6 with a straight selection sort

display

2.8. Write a recursive Quicksort algorithm according to the recipe that the sorting

display

2.9. Find a permutation of the keys 1, 2,..., # for which Quicksort displays its

display

2.10. Construct a natural merge program similar to the straight merge Program

display
123

2.11. Note that in a (two-way) natural merge we do not blindly select the least

display

2.12. What purpose does the variable ta in Program 2.15 serve? Under which

display

2.13. Why do we need the variable Jast in the Polyphase Sort Program 2.16, but

display

2.14. A sorting method similar to the Polyphase is the so-called Cascade merge

display
↑ Up