Programming and Computer Science in Java:
Homework #1:
Sorting Algorithm

    David Kosbie, 2002-2003
See Course Home Page

Due Date:  Tue, Feb 4, 2003

First, read Chapter 1 from Downey.  Study this for a quiz tomorrow.  Then, do the following problem.

Today in class we learned that an algorithm is a precisely-worded description of how to solve a problem.  One such problem is sorting:  given an unsorted stack of cards, place them in sorted order (that is, from smallest to largest).  In class, we covered two different sorting algorithms:

Insertion Sort:  Repeatedly insert the top card from the unsorted stack into its sorted position in the sorted stack.

Selection Sort:  Repeatedly select the smallest remaining card from the unsorted stack and place it on the top of the sorted stack.

Your homework for tonight is to discover yet another sorting algorithm of your own invention.

Good luck!



See Course Home Page