Chapter 6
Animated Algorithms

Overview
We discuss a method for visualizing the workings of three standard sorting algorithms. The method uses "hooks" in an auxiliary function to obtain run-time data without modifying the implementation of the sorting algorithms themselves.

Section 1 introduces the three algorithms considered: insertion sort, selection sort, and quicksort. Next, we develop the tools for producing graphics and animations that show how the algorithms perform on various inputs. Some more tools are used to investigate the behavior of sorting algorithms for large inputs. We treat them in Section 3.

Finally, we mention an improvement to a package for producing static views of animations that we developed for the applications in this chapter.

Programs
Sorting.m
SortVisual.m
SortAux.m
SortAuxG.m
FlipBookAnimation.m
This file is part of standard Mathematica. It is in the SystemFiles/Graphics/TextResources directory.
Notebooks
SortingExamples.nb

Top Up Next Internet Updates

Rev. 1.0, REM, © 1996 Roman E. Maeder