Using Algorithm Visualization to Improve Students' Understanding of Parameter Passing Methods

2003-2004 CREW Research Project


Program Authors:  Jessica Gowey and Orjola Kajo

                             Students -- University of Wisconsin-Oshkosh

Faculty Advisor:  Thomas Naps

                            Professor Computer Science Department -- University of Wisconsin-Oshkosh



Project Abstract

Program Images

Statistical Results

Full Project Paper, presented at 37th Annual Midwest Instruction and Computing Symposium April 16-17th, 2004, University of Minnesota, Morris


Download the Program


Project Abstract

Some of the most difficult concepts for students to master in a junior-senior level course on programming languages involve the differences between parameter-passing methods, such as by-reference, copy-restore, by-name, and macro processing.

Algorithm visualization (referred to as AV) uses computer graphics to depict the actions of an algorithm. In this project, our work in AV is used as a tool to help students understand these parameter-passing methods more easily and in greater depth.

We have developed a program that creates a random instance of a parameter-passing problem and then solves it by using either by-reference and copy-restore or by-name and macro processing methods. The solution to the problem is hidden with the purpose of being unveiled by the student.

The visualization of the solution is presented to the student as a sequence of snapshots supplemented with interactive questions that force the student to predict what will happen next and find a solution.

Our goal is to statistically test the following hypothesis - ``Students who use AV learn parameter-passing significantly better than students who use no visualization''.

Program Images

The image below is the program on start-up.  The user is able to select one of four parameter passing methods and also choose to use old or new data (solving the previous problem using a different parameter passing method or solving a new problem).

 JHave Start Image                      JHave Start w/ drop down menu


After selecting the parameter passing method, the user is prompted to make some choices about the types of problems to be created. This choice will add or subtract from the difficulty level of the problem generated. (The image on the left is for Copy-Restore and By-Reference, and the image on the right is for By-Name and Macro)

Input Box1       Input Box2


When the program starts running, it will step through and hi-light lines of the program corresponding with the images being created on the left.  In the graphics, each variable created in a different scope is given a different color to ease the user in following the progression of the program. 

Copy/Ref Start


After all variables have been declared, questions are created and displayed.  The program pauses and allows the user to answer these questions, being told if the the answers provided are correct or not.  The user does not need to answer them, they may click next and continue viewing the program execution.

Image after Variables are created


Wrong answer supplied


Arrows are also used to help the user understand how certain variables refer back to others.

 When the correct answer is supplied


Shows arrows