Some instructionally oriented graphi c displays of algorithm execution can b e enhanced by the use of a cumulative graphi c trace, which presents a stylized visua l representation of the history of th e algorithm's operation on a data structure . This graphic trace can convey informatio n about the order in which operations wer e done or elements were processed , information which is often not available i n dynamic displays of algorithm execution . It can also in some cases serve as i n "icon" to help students remember th e algorithm or contrast it with simila r algorithms . The use of cumulative graphi c traces in the study of various sortin g algorithms is illustrated .
. CUMULATIVE GRAPHIC TRACE SThe purpose of this article is to defin e and illustrate the use of cumulativ e graphic traces in program visualization fo r competer science instruction, specificall y in visualization of sorting algorithms . (In the terminology recommended by Brad A . Myers [1986], program visualization is th e graphic illustration of programs or thei r execution .) Program visualization system s which include displays of algorithms ar e fairly widely used in computer scienc e instruction .The displays may show th e algorithms in flowchart form, as pseudocod e or as source code .(Stone [1987] an d Scandura [1987] discuss progra m visualization using Scandura FLOWforms, a n enhanced version of Nassi-Shneiderrna n diagrams . Scanlan [1987] reports that dat a structures students prefer to learn fro m flowcharts . )The emphasis in this article, however, i s on program visualizations which includ e dynamic displays of data during algorith m execution . Brown (1988) presents a usefu l taxonomy of algorithm animation display s and discusses a number of examples i n light of this taxonomy . His classificatio n has three dimensions : content (directl y SIGCSE Vol . 21 No . 4 Dec . 198 9 flULLETII1 referenced in the algorithm vs . syntheti c or derived), persistence (current state vs . complete history), and transformatio n (discrete vs . incremental or continuous) . Another possible dimension for displays i s whether they show relatively abstrac t representations of data structures o r representations which emphasiz e implementation details (or both ; see Maxi m and Elenbogen [1987]) . Some recent report s on animated data displays for instructiona l purposes are McGlinn (1989), Myers , Chandhok and Sareen (1988), and Augenstei n and Langsam (1988) .A cumulative graphic trace presents a stylized visual representation of th e history of an algorithm's operation on a data structure . It is constructe d (probably adjacent to a representation o f the data structure) while the algorith m executes, and its purpose is to provide a record of what operations were done, wha t order they were done in, and what element s of the data structure they were done to . It supplies information about the tempora l sequence of operations by means of a spatial pattern ; one of the dimensions o f the graphic trace generally corresponds t o time .More specifical...