CPS 49S - Sorting

CPS 49S - Spring 2001 - Rodger

Sorting


Sorting (ginorSt)

This assignment is to be handed in.

You should work on this with your partner. You may not work alone!

There are three parts to this activity:

All of the written parts should be put into a web page called sorting.html and linked from both of your cps 49s web pages.

1. Sorting the Words

Your group will be given approximately 100 words. You are to sort them into alphabetical order. You should arrange the words in such a way that your group can answer questions such as

The success of your work will be judged on whether you can correctly answer most of these questions. However, you must also finish this assignment during the class period.

2. Specifying an Algorithm

Each group must prepare one write-up as described below. Be sure that each group member's name (first and last name) is on the write-up.

You are to write an explanation of how to sort a list of words. Assume that the number of words isn't known in advance, but will be between 10 and 600. You are to write an algorithm in English that specifies precisely how to sort the words. Consider that another group might use your algorithm, and following the instructions literally. This means that you must convey exactly what steps to follow.

Saying "put in alphabetical order" is too vague. The end result is alphabetical order, but which "algorithm" or method should you use to put them in this order. There are lots of words. How do you organize them?

3. Questions

The answers to these questions should also be put on your sorting.html web page.

  1. You can refuse to answer one of the questions below. The questions refer to the "sorted" list of words.
    1. How many words begin with the letter 'm'?
    2. What is the last word with a double letter (e.g., ``jello'')?
    3. How many words are there?
    4. Is the word "preternatural" in the list of words?
    5. How many words end in the letter 's'?
    6. How many words begin with a vowel?
    7. What is the 66th word?
    8. What is the 13th word?
    9. How many words contain the word "her" in them?
    10. What is the group's favorite word?
    11. What is the 100th word?
  2. Did you refuse to answer 1 of the above questions. Why?
  3. Did you organize the words in any special order besides just sorted to answer the questions above? Explain.

If you don't finish this assignment in class, you should finish it for homework, and complete it by the beginning of the next class.

If you finish before class is over, you can just continue to work on your web pages trying out other items from the tutorial.


Susan Rodger
Last modified: Sat Jan 20 16:11:47 EST 2001