Sorting Intro

Save a copy for yourself of this Google doc. Follow the instructions in that document. For your convenience, the contents are shown below.

Submit your google doc using this form, submitting this within 24 hours of the end of class.

Contents of Google doc:

  1. What are examples of sorting that you have encountered today? It might help you to think of situations that could have gone wrong in your life if somebody else did not do the sorting correctly.




  2. Take a strip of paper about 8 inches long and evenly spaced out write down the numbers 1..7. Then tear it so each number is in a separate square, that you can move around by itself. You will use these to design a sorting algorithm, writing down the steps precisely so that another student could replicate your results. Have these numbers available for use during class on Monday as well.


Start with your numbers in this order: 4 1 6 2 7 3 5


Write down the precise steps that you would use to put these numbers into order, subject to these constraints:

  • You can only compare two numbers at a time and keep track of which one is the smallest. You can’t, for instance, look at all of them and “choose the smallest”.

  • You can swap two numbers with each other

You should not expect to have the same algorithm and results as everyone else.
Write down your numbered precise instructions here:


  1. ...




  1. Using your algorithm on the above starting sequence of numbers to sort them, figure out the following, which you will be asked to enter on the submission google form:

    1. Total number of comparisons

    2. Total number of swaps