Docsity

Assignment 1 for Elements of Computer Science | COMP 200, Assignments of Computer Science

Toggle sidebar
bg1
In class on Wednesday (August 24, 2004; lecture number 2), we went out
into Martel Hall and sorted the class into ascending order by first name. If
you skipped that class, then you must do the following as preparation for the
homework assignment.
• Gather at least seven friends.
• Starting from a chaotic grouping, sort yourselves into ascending order
by first names.
• Observe how you accomplished this goal.
If you attended class, this preparation should be unnecessary.
The Assignment
Write a concise algorithm for sorting the class into ascending order by first
name. Your algorithm should work for arbitrary sets of individuals. It
should describe a technique that solves the entire problem — not the actions
that one individual must take, but an overall process that applies to all
individuals and, at its termination, produces the sorted set of individuals.
Questions that you should ponder include:
• What does your algorithm do with people who have identical names?
• What does your algorithm do with an empty input set?
• Does your algorithm halt and produce the correct answer?
You may assume that every individual has a name, that all the names are in
the same alphabet (so comparisons make sense), and that the number of
individuals is finite.
Handing In the Assignment
Write down your algorithm. (Typed work is preferable.) You may work in
pairs, if you chose. A pair should submit a single copy of their solution.
The assignment is due at the start of class on Monday, August 30, 2004
Read and follow the guidelines for homework posted on the website.
COMP 200: Elements of Computer Science
Fall 2004
Homework 1, Due Monday, August 30, 2004

Partial preview of the text

Download Assignment 1 for Elements of Computer Science | COMP 200 and more Assignments Computer Science in PDF only on Docsity!

In class on Wednesday (August 24, 2004; lecture number 2), we went out into Martel Hall and sorted the class into ascending order by first name. If you skipped that class, then you must do the following as preparation for the homework assignment.

  • Gather at least seven friends.
  • Starting from a chaotic grouping, sort yourselves into ascending order by first names.
  • Observe how you accomplished this goal.

If you attended class, this preparation should be unnecessary.

The Assignment

Write a concise algorithm for sorting the class into ascending order by first name. Your algorithm should work for arbitrary sets of individuals. It should describe a technique that solves the entire problem — not the actions that one individual must take, but an overall process that applies to all individuals and, at its termination, produces the sorted set of individuals.

Questions that you should ponder include:

  • What does your algorithm do with people who have identical names?
  • What does your algorithm do with an empty input set?
  • Does your algorithm halt and produce the correct answer?

You may assume that every individual has a name, that all the names are in the same alphabet (so comparisons make sense), and that the number of individuals is finite.

Handing In the Assignment

Write down your algorithm. (Typed work is preferable.) You may work in pairs, if you chose. A pair should submit a single copy of their solution.

The assignment is due at the start of class on Monday, August 30, 2004

Read and follow the guidelines for homework posted on the website.

COMP 200: Elements of Computer Science Fall 2004 Homework 1, Due Monday, August 30, 2004