CS361, Spring 2024

Animations

A number of the more important or interesting algorithms covered in this course are available as animations using the AlgAE (Algorithm Animation Engine) system.

These allow you to view a picture of the data being manipulated while you “play” an algorithm like a DVD or DVR, forward or reverse, pausing, moving continuously or just a short hop at a time, much as if you were desk checking the algorithm.

Launching the Animations

Download the animation

Right-click on one of the links and select the “Save … as” option (the exact wording varies from one browser to another).

Launch the animation.

Each animation is packaged as a .jar file. You will need a Java Runtime Environment (JRE) or Development Kit (JDK) version 11 or later, which you may well already have on your PC. If not, get it here. I recommend sticking with the LTS (Long Term Support) versions.

_Recent releases of Java appear to have broken backwards-compatibility with older like these demos. If the animation launches but does not activate the Algorithm menu, or if the picture seems to flicker badly,

Running the Animation

  1. Use the Algorithm menu to select the desired algorithm.

    (Tip: when creating data structures, keep them small. You will be stepping through the algorithms in fine detail.)

  2. Use the “step” button to advance the algorithm and pause. Or use the “play” button to advance continuously. The “pause” button can be used to stop a running animation.

  3. If you find the display is too hopelessly tangled, you can use your mouse to drag the objects to more appropriate positions whenever you are paused within a running algorithm.

Available algorithms

These feature code from the textbook (Weiss) and/or from the lecture notes.

Sequences

Trees

Hashing

The hashing demos use a deliberately awful hash function (length of the string) to make it easy to select inputs that will collide. This allows you to observe collision handling easily.

Graphs

(Right-click on the links and select “Save link as…” or the nearest thing offered by your browser to download.)