Using algorithm visualization to facilitate the teaching of algorithms
Stavros Nikou is one of the members of the Xplora teachers group.
He teaches both Computer Science in secondary public schools and programming, databases, internet and multimedia in vocational schools.
His article gives us an insight into the benefits of the algorithm visualization to facilitate the teaching of algorithms.
As a Computer Science teacher, one of the subjects I teach is Algorithms, basically an introductory level course: very simple concepts in Gymnasium and more detailed algorithmic constructs in Lyceum, such as sequence, repetition, selection, as well as simple static data structures and some operations on them (searching, sorting etc).
Learning about algorithms is sometimes very difficult for students because software is an abstract material itself. The point is to make both the data and operations of the algorithms more easily understandable.
Along with the traditional presentation of the algorithm on the “blackboard”, and the graphical debugger tool of the programming language that is to be taught, I try to facilitate the teaching using algorithm visualization.
“Software Visualization is the use of the crafts of typography, graphic design, animation, and cinematography with modern human-computer interaction and computer graphics technology to facilitate both the human understanding and effective use of computer software.”1
There are two main sub-areas of software visualization:
• Program visualization (with a software engineering focus), which is the use of visualization to help programmers, coders, developers.
• Algorithm visualization (with a pedagogy focus), which is the use of visualization to help teach algorithms and data structures.
The idea behind algorithm visualization is to use graphical techniques to represent both data and operations. The question is “Do Algorithm Animations Aid Learning?”2
Do algorithm animations actually help students learn?
They say that “a picture is worth 10.000 words”. Is this true when it comes to teaching algorithms?
Researchers give mixed results. According to some, using animation to help teach algorithms has less beneficial effects on learning than hoped3. This may be true in some cases but when algorithm animation is constructed in an efficient way 4 and used appropriately along with other pedagogical methods, it can help the learning process. This is what our little class experience has shown so far.
Our approach is as follows:
• First, students are given a lecture describing the algorithm, along with some theoretical tracing on the “blackboard” using sample data sets.
• Second, some multiple-choice questions are handed out to the students to test their understanding of the algorithm so far.
• Then, we introduce some graphical representations as it is explained below.
• Finally, after the visualization, multiple-choice questions are distributed a second time. And they usually show a better understanding of the algorithm.
Depending on the algorithm and the students’ background, we use different algorithm animation tools:
• Students in groups are asked to prepare algorithm visualizations on their own. They usually use Microsoft PowerPoint, but Macromedia Flash can also be used. An example of such presentation is the for loop.pps file.
• Web resources - java applets with some very useful animations especially for searching (sequential, binary) and sorting methods (bubble, insertion, selection etc).
Have a look at:
• Use of algorithm animation tools such as:
- Jeliot3- The algorithmic theater
Jeliot 3 is a Program Visualization application. It visualizes how a Java program is interpreted. Method calls, variables, operation are displayed on a screen as the animation goes on, allowing the student to follow step by step the execution of a program. It is a free software (under the terms of the GNU General Public License) running on windows machines.
- ALgorithm VIsualization Storyboarder (ALVIS)
ALVIS 2.0 is a tool for algorithm visualization technology that supports the rapid construction and interactive presentation of "low fidelity" algorithm visualizations as their creators state.
Finally, a few comments on the use of algorithm visualization:
• Students acquire more interest in the subject and get more motivated.
• They understand the algorithm better.
• When students interact with the animation of the algorithm i.e. provide their own data sets and try to predict the next step, the benefit is usually more important than if they were just watching passively the algorithm execution.
As a conclusion, using algorithm visualization in teaching algorithms, along with other methods, accelerates and enhances the learning process.
1. Price, Baecker and Small, “Introduction to Software Visualization” , MIT Press, 1998
2. Michael D. Byrne, Richard Catrambone, John T. Stasko, “Do Algorithm Animations Aid Learning?”, Georgia Institute of Technology, 1996
3. Colleen Kehoe, John Stasko, Ashley Taylor, “Rethinking the Evaluation of Algorithm Animations as Learning Aids:An Observational Study”, Georgia Institute of Technology, 1999
4. Rudolf Fleischer and Ludek Kucera, “Algorithm animation for teaching”