<?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>Memory Performace Application Cards</cat:title>
<cat:author>Kate</cat:author>
<cat:date>April 19, 2004</cat:date>

<cat:technique>Application Cards</cat:technique>

<cat:purpose>
<p>
Instructors can find out how well students understand how to apply knowledge of how memory and caches work in order to explain unexpected performance results in algorithms.
</p>
</cat:purpose>
<cat:activity>
<p>
Read the following scenario and answer the question. Be certain to back up your decisions.
</p>

<p>
You are presented with two mergesort routines, MSORT1 and MSORT2. For small lists, both perform the same. For larger lists, however, MSORT2 significantly outperforms MSORT1. Comparing the code of the two routines, you find that both use roughly the same number of machine instructions. 
</p>

<p>
What could possibly be the difference that makes MSORT2 perform better than MSORT1?
</p>
</cat:activity>
<cat:solution>
<p>
Student answers will vary greatly. The most direct answer is to realize that the merge sort routine in MSORT1 is prone to thrashing the cache.
</p>
</cat:solution>
<cat:analysis>
<p>
Read through the applications and sort or mark them as "Good," "Acceptable," "Marginal," or "Wrong." Read through the piles again to make sure that you have not accidently misclassified a response. You might also want to sort the responses by the type of explanation given.
</p>

<p>
Choose three or four of the best examples from the "Good" pile. Emphasize understandability, but try to have a diversity of example domains. Also consider a few acceptable and marginal responses that highlight points you wish to discuss.
</p>

<p>
If you use an application in class as a bad or poor example, change the application just enough to disguise the example from the original authors.
</p>
</cat:analysis>
<cat:variant_uses>
	<cat:variation>Have students write applications individually and submit these to the instructor anonymously. The instructor reads the applications and the class discusses the merits of these applications. The instructor might want to describe what the code would look like for some of the applications.</cat:variation>
	<cat:variation>Each student writes an application and explains their application to the rest of the class.</cat:variation>
	<cat:variation>Break students into small groups (2-4 people) and have each group find two or more applications. Have each group explain their applications to the rest of the class.</cat:variation>
</cat:variant_uses>
<cat:classification>
<cat:assessment_goals>
	<cat:goal>Develop ability to apply principles and generalizations already learned</cat:goal>
	<cat:goal>Learn concepts and theories in the subject</cat:goal>
	<cat:goal>Develop capacity to think for oneself</cat:goal>
	<cat:goal>Develop ability to think creatively</cat:goal>
	<cat:goal>Develop ability to draw reasonable inferences from observations</cat:goal>
</cat:assessment_goals>
<cat:topics>
	<cat:topic>Sorting</cat:topic>
	<cat:topic>Real World Scenarios</cat:topic>
	<cat:topic>Merge Sort</cat:topic>
	<cat:topic>Memory</cat:topic>
	<cat:topic>Efficiency</cat:topic>
	<cat:topic>Cache</cat:topic>
</cat:topics>
<cat:participation_level>
</cat:participation_level>
<cat:time>
	<cat:preparation_time>LOW</cat:preparation_time>
	<cat:class_time>MEDIUM</cat:class_time>
	<cat:in_class_analysis_time>MEDIUM</cat:in_class_analysis_time>
	<cat:out_class_analysis_time>MEDIUM</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>Difficult to Enable</cat:device_enabled>
<cat:related_topics>
	<cat:topic>Algorithms</cat:topic>
	<cat:topic>Data structures</cat:topic>
	<cat:topic>Design</cat:topic>
	<cat:topic>ADTs</cat:topic>
	<cat:topic>Analysis</cat:topic>
</cat:related_topics>
</cat:classification>
</CAT>