You are on page 1of 1

QUICK SORT

Name__________________________

Follow the algorithm for a quick sort and analyze its usefulness.

The algorithm for a quick sort is as follows:


1. Take a random card from the set and turn it face up. Place that card up above the rest.
2. Flip the first card of the set face-up. If it is smaller than the card from step 1, place it face-down
in a pile to the left. If it is greater than the card from step 1, place it face-down in a pile to the
right. If it is equal, place it face down in a pile below the card from step 1.
3. Repeat steps 1-2 for each of the smaller piles you just made. Continue repeating until there are
no piles with more than one number in them.
4. Combine all of the piles together in the order they are currently in.
Perform the quick sort on your set of 8 cards.
1) What is the least number of steps this method could take?

2) What is the maximum number of steps this method could take?

3) What about if you used n cards?

4) If you were to alphabetize the books on a bookshelf using this method, what would that look
like?

You might also like