<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE CAT [ <!ENTITY nbsp  "&#160;"> ]>
<CAT xmlns:cat="http://www.w3.org/TR/html4/" version="2.0"> 
<cat:title>Sorting Defining Features Matrix</cat:title>
<cat:author>Kate Deibel</cat:author>
<cat:date>March 30, 2004</cat:date>

<cat:technique>Defining Features Matrix</cat:technique>

<cat:purpose>
<p>
This exercise gives instructors the chance to find out if students understand the similarities and differences between various sorting algorithms.
</p>
</cat:purpose>
<cat:activity>
<p>
Fill out the following matrix. This matrix lists various sorting algorithms and it's your job to decide if these algorithms possess various properties. Assume that your are assorting arrays, not linked lists. Please complete the table with '+' or '-' labels.
<br></br>

</p>

<center>

<table border="1">
<tr>
<td align="center">
&nbsp;
</td>
<td align="center">
O(n log n running time)
</td>
<td align="center">
Best-case performance: O(n)
</td>
<td align="center">
Stable
</td>
<td align="center">
In-place
</td>
</tr>
<tr>
<td align="center">
Selection Sort
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td align="center">
Insertion Sort
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td align="center">
Merge Sort
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td align="center">
Quick Sort
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td align="center">
Heap Sort
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
</table>
</center>
</cat:activity>
<cat:solution>
<br></br>

<center>

<table border="1">
<tr>
<td align="center">
&nbsp;
</td>
<td align="center">
O(n log n running time)
</td>
<td align="center">
Best-case performance: O(n)
</td>
<td align="center">
Stable
</td>
<td align="center">
In-place
</td>
</tr>
<tr>
<td align="center">
Selection Sort
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td align="center">
Insertion Sort
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td align="center">
Merge Sort
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
</tr>
<tr>
<td align="center">
Quick Sort
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td align="center">
Heap Sort
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
</tr>
</table>

</center>
</cat:solution>
<cat:analysis>
<p>
The following must be done out of class:
</p>

<ol>
<li>In a first pass, mark and count the number of incorrect answers. Also, mark any answers that you find surprising.</li>
<li>For each question that has a significant (your judgement call) of incorrect answers, do the following:
<ol type="a">
<li>Look through the answers to these questions.</li>
<li>Attempt to identify the nature of the most common errors that are made.</li>
</ol>
</li>
<li>Discuss these errors in class, using the common mistakes that you identified .</li>
</ol>

<p>
In-class feedback can be done by having students write or say out loud their own answers, but caution must be taken to avoid embarassing or ridiculing a student for making mistakes.
</p>
</cat:analysis>
<cat:variant_uses>
	<cat:variation>Have students write short explanations for their answers in the matrix.</cat:variation>
	<cat:variation>Have students work in groups to complete this activity. The instructor may want to circulate throughout the groups to ensure that each group is making progress. After the groups have completed their matrix, the instructor can ask for volunteers for each item. Be sure to ask for explanations as to why they assigned a plus or minus to each column.</cat:variation>
	<cat:variation>Have students work individually on their problems and form a small group to discuss their answers.</cat:variation>
</cat:variant_uses>
<cat:classification>
<cat:assessment_goals>
	<cat:goal>Develop analytic skills</cat:goal>
	<cat:goal>Improve memory skills</cat:goal>
	<cat:goal>Learn terms and facts of this subject</cat:goal>
	<cat:goal>Learn concepts and theories of this subject</cat:goal>
</cat:assessment_goals>
<cat:topics>
	<cat:topic>Sorting</cat:topic>
	<cat:topic>Algorithms</cat:topic>
	<cat:topic>Efficiency</cat:topic>
	<cat:topic>Complexity</cat:topic>
	<cat:topic>Stable sorts</cat:topic>
	<cat:topic>In-place sorts</cat:topic>
</cat:topics>
<cat:participation_level>
</cat:participation_level>
<cat:time>
	<cat:preparation_time>MEDIUM</cat:preparation_time>
	<cat:class_time>LOW</cat:class_time>
	<cat:in_class_analysis_time>LOW</cat:in_class_analysis_time>
	<cat:out_class_analysis_time>LOW</cat:out_class_analysis_time>
</cat:time>
<cat:instructor_response>
	<cat:response>Lecture</cat:response>
	<cat:response>Next Day Summary</cat:response>
	<cat:response>Class Discussion</cat:response>
	<cat:response>Small Group Discussions</cat:response>
	<cat:response>Homework</cat:response>
</cat:instructor_response>
<cat:device_enabled>Has Been Enabled</cat:device_enabled>
<cat:related_topics>
	<cat:topic>Search</cat:topic>
	<cat:topic>Trees</cat:topic>
</cat:related_topics>
</cat:classification>
</CAT>