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

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


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

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

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

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

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

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

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

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

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

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

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