9 comments

[ 3.4 ms ] story [ 23.8 ms ] thread
Interesting. I've been working on an interactive 3D algorithm/data structure visualizer (http://tiledtext.com/projects/avd), but was thinking of it more as a debugging tool than an educational aid. I like the catalog aspect here: would be nice to have one of these for every wikipedia algorithm page.
The visualizer is really nice, the examples could use some work though.

Selection Sort, for example, makes the algorithm look extremely (impossibly) good at first glance - O(n) - because it's not showing the majority of the steps.

Instead of

    for (var j = i + 1; j < D.length; j++) {
        if (D[j] < D[minJ]) {
            tracer._select(j);
            minJ = j;
            tracer._deselect(j);
        }
    }
it has to be

    for (var j = i + 1; j < D.length; j++) {
        tracer._select(j);
        if (D[j] < D[minJ]) {
            minJ = j;
        }
        tracer._deselect(j);
    }
Bubble Sort has the same problem, as do Quicksort and Mergesort.

Normally I wouldn't mind, but these examples are intended for beginners, and it might give them a false sense of time complexity for these basic algorithms.

Really nicely done! The animations though would be more enlightening if you exposed more of the algorithm state in them, e.g. by showing how the queue grows and shrinks in the BFS visualization.
Fantastic tool! I wish more code visualization tools like these were available.

Great job.