CPS 49S: JAWAA sorting

Sheila Powenski and Jenna Vanliere

We are sorting our rectangles by size, smallest to largest, right to left. In order to do this, we start by comparing the first two rectangles. If the rectangle to the right is smaller, it switches places with the rectangle to the left. Then we move to compare the third and second rectangle. If the third rectangle is smaller, it switches places with the second rectangle. If a switch is made, then the third rectangle would then be compared to the first rectangle and possibly another switch would be made. So, a rectangle is compared to the rectangle on its left and switched if it is smaller. If not, the program moves on to compare the next rectangle up in the series.