In this lab session you will implement the left tree_rotate_left function required in HW5. You will also have the option of working on an implementation of the quicksort algorithm. If you'd rather work on quicksort, just skip the tree rotation portion of the lab. (However, if you haven't yet finished HW5, it is suggested that you do the tree rotation portion first.)
Recall that the steps involved in performing a left rotation on the subtree with root oldroot are the following:
Examine the file named quick.cxx in the directory /cs/cs2005/samples/lab5/. This file contains a test program for the quicksort function. A partial implementation of quicksort is also provided. However, the crucial partition function needed for quicksort has not been implemented. See the notes in quick.cxx and read the relevant parts of chapter 13 for information about the partition function. In particular, a pseudocode outline of the partition function appears on p. 601 of the book. Work on implementing the partition function and thus on obtaining a complete implementation of quicksort.
Once you've implemented the partition function, modify the test program in quick.cxx so that it obtains its input from a file instead of the console, and so that it allows larger arrays (say thousands of items instead of just 10). Test quicksort on some sample files to see how its performance scales up to larger input sizes. If you want to be fancier, provide a function that generates samples input files automatically.
This problem is challenging and you should not be disappointed if you can't completely solve it before the end of the lab session. Good luck!