SWAN: A Student-Controllable
Data Structure Visualization System
Clifford A. Shaffer, Lenwood S. Heath
Jun Yang
and Jeffrey M. Nielsen
Department of Computer Science
Hughes Network Systems
Virginia Tech
11717 Exploration Lane
Blacksburg, VA 24061
Germantown, MD 20876
{shaffer,heath,jnielsen}@cs.vt.edu
jyang@hns.com
Abstract: Swan is a data structure visualization system. Its main purpose is to allow the user to
visualize the data structures and the basic execution process of a C/C++ program. Swan views a
data structure as a graph or a collection of graphs. By “graph,” we include both general directed
and undirected graphs and special cases such as trees, lists and arrays. As a part of Virginia
Tech’s NSF Educational Infrastructure Grant, Swan will be used in two ways: by instructors as
a teaching tool for data structures and algorithms, and by students to animate their own programs
and to understand how and why their programs do or do not work.
1 Introduction
Students in Computer Science are constantly asked to understand dynamic processes in the form of computer
algorithms. Aside from a pseudocode or computer program implementation, a higher order description for the
algorithm is usually conveyed in words, perhaps with a well-chosen picture or two. Unfortunately, computer code,
words and individual pictures present only static descriptions, specific views or instances of a dynamic process.
Perhaps the reason why some otherwise good students have trouble understanding code examples is that they are
unable to translate such static descriptions to a dynamic process in their imagination.
Many of the algorithms studied in undergraduate computer science courses operate on fundamental data struc-
tures such as lists, trees and graphs. Thus, a natural visual component to the workings of many algorithms is the
series of changes that take place to the corresponding data structure. A well organized presentation of these
changes in the form of a graphical visualization can help to bridge the “concept gap” encountered by man