I am quite stumped by this question.
I tried to code it up so that I could see what it was doing, but I get an error
swap(first+2, last); //this is the first swap line in the partition function in the tut letter.
main.cpp(9) : error C2440: 'initializing' : cannot convert from 'int' to 'int &'
So because I have no idea how to make this int a reference I decided to go through the code logically.
I started with looking at the quickSort method in the tut letter and I'm confused.
If I take the example array of {5,8,0,2,5,3,7,2,6} and start applying the algorithm, after the sortFirstThree, the array looks like {0,5,8,2,5,3,7,2,6}. But then, first+2 (which is 8 if I'm not mistaken) is not less than last (which is 6). Then the code inside the if statement will not execute and the list will not be sorted.
Can anyone tell me what I'm missing here?
****** NOTE
I'm sorry - it seems I have the dumb today. I see now that first+2 is the INDEX and not the VALUE of the array at first+2. I knew I'd get it once I asked. Why can't we delete posts here anymore?