Merge Sort
Two hundred forty line segments, each encoding an array value by rotation angle, animate through seven passes of bottom-up merge sort. Randomly shuffled values are rendered as SVG lines, with each pass showing sorted sub-arrays as groupings of parallel bars. The animation uses `d3.shuffle`, `d3.scale.linear`, and `transition.attr` to smoothly rotate lines into new positions. The design resembles wind gusting over grass, making sorted runs visually distinct.
AI-generated descriptionThis animation is based on elegant visualizations by Robert Sedgewick, published in Algorithms in C (1998). Seven sequential passes of a bottom-up merge sort algorithm are shown, with array values encoded using angle. The design, reminiscent of wind gusting over tall grasses, allows rapid perception of sorted sub-arrays. Based on an earlier Protovis example.
See also quick sort.