--000e0cd182a4febb39047ebf0e9c
Content-Type: text/plain; charset=ISO-8859-1

One thing that can be helpful when thinking about algorithms, is to think
how you would do it personally.

Try getting ten cards, shuffle them up, and then put them into order.

What did you do when you put them into order?
How did you decide what went where?

Perhaps you had cards in your hand, then took the top one off, and put it on
the table, then one by one took the next consecutive card from your hand,
and added it to the ones on the table, in the place that it would belong in
that list of cards.

Perhaps you looked at the cards, and found the smallest one, then put that
one on the table, then took the next smallest and put that one on the table,
and so on until there were none left.

Think about the steps that you are performing, can you break them down into
a set of instructions? Can you write a "recipe" that if you were to follow
it, the cards would end up sorted?

1. put unsorted cards in hand
2. sorted cards will go on the table
3. take first card, do this or that
4. ...
...

Try to write a set of instructions like this, in English, that reflect what
you do when you sort the cards. Then think about what it would take to
translate that into something that a computer language would be able to
understand and execute. We are using strings (text) instead of cards, but
the basic set of instructions is still the same, and if you can explain how
to sort cards in clearly defined steps, then you can program a string
sorter.

Once you have this, think about what types of containers do you need to
implement your instructions?
What kind of logic do you need to have written, and how can you write it in
such a way that it makes sense to the computer?

Try thinking about these questions, you already know how to sort cards, you
just need to figure out how to tell the computer to do what you are already
doing.

Good luck :)

--000e0cd182a4febb39047ebf0e9c--