CSC 216/s08/eschew disenchantment: Difference between revisions
(→=Setup) |
(→Setup) |
||
Line 17: | Line 17: | ||
There should be a pseudocode description of the merge sort algorithm on a large display. | There should be a pseudocode description of the merge sort algorithm on a large display. | ||
The numbered notecards must be taped together in a randomly ordered line. | The numbered notecards must be taped together in a randomly ordered line. | ||
=====Pseudo Code===== | |||
<code> | |||
public int[] mergeSort() { | |||
</code> | |||
====Activity==== | ====Activity==== | ||
First, the seven hats need to be assigned to the seven students. Then the student wearing the king hat should perform as though he is the initial call to mergeSort(). The king should use his delegates to handle his recursive mergeSort calls. The delegates should use their peons to handle their own mergeSort() calls. | First, the seven hats need to be assigned to the seven students. Then the student wearing the king hat should perform as though he is the initial call to mergeSort(). The king should use his delegates to handle his recursive mergeSort calls. The delegates should use their peons to handle their own mergeSort() calls. |
Revision as of 17:56, 25 March 2008
Formatting Resources
Formatting Help Guide from MetaWiki
The Hierarchical Merge Sort
The problem
In this exercise, we want to teach students the mechanics of a merge sort algorithm.
Participants and props
Seven students will participate in the exercise. They will need numbered notecards, scotch tape, and a series of hats. There should be seven hats as follows: One master hat, two delegate hats, and four peon hats.
The script
Setup
There should be a pseudocode description of the merge sort algorithm on a large display. The numbered notecards must be taped together in a randomly ordered line.
Pseudo Code
public int[] mergeSort() {
Activity
First, the seven hats need to be assigned to the seven students. Then the student wearing the king hat should perform as though he is the initial call to mergeSort(). The king should use his delegates to handle his recursive mergeSort calls. The delegates should use their peons to handle their own mergeSort() calls.