CPS 49S: Jawaa Sorting

Brian Rudick and Betsy McDonald



Algorithm

  1. We started by visually finding the shortest rectangle and moving that to the first position, swapping it with whatever rectangle was already there
  2. Then we found the second smallest rectangle and moved it to the second position, swapping with the rectangle that was already there
  3. We continued this process to fill all 10 positions with the appropriate rectangle
  4. If a rectangle was already in the appropriate position, we looked at it and then moved on to the next shortest rectangle