Activity Sheet 9
- Manager
- name:
- Recorder
- name:
- Speaker
- name:
Section 5.2
- We will sort the letters in the word ALGORITHM by using quicksort. For simplicity, once we have 3 elements or less we simply sort them by inspection. So we will only focus on the steps that get us to that point.
- What pivot would the “median-of-three” method choose? Your first step will swap the pivot to the first element.
- Carry out Hoare’s partition algorithm. What does the array look like at the end of that? What is the returned index?
- Repeat the above two steps for any of the two parts of the partition that has more than 3 elements.