Visualizing Algorithms (2014)
bost.ocks.org
bost.ocks.org
If seeing these visualizations of algorithms can significantly speed up human understanding, how beneficial would it be for onboarding people to (e.g.) open source projects, if the codebase had its central algorithms visualized?
For instance, consider introducing someone to the Git codebase for the first time. What if the first step was allowing them to just use Git, while they could see the data comprising the working tree, index, commit tree, etc. changing as they performed various actions? After that, they could go to the code and see which parts were responsible for producing the visualization.
Or, what if library/framework/language maintainers incorporated it to teach people how to use/debug their systems. E.g. the 'state_machine' Ruby gem. How valuable would it be if users of the library could turn on a debug flag and just see their state machines being constructed and operating?
There's a video of the visualizer I'm working on running here (including another visualization of quicksort towards the end): http://symbolflux.com/projects/avd
When math produces data that fundamentally challenges your understanding of what's happening under the hood, you (I) really wish there were better ways to visualize what's happening, even if only to verify that it's happening correctly.
It gets hard to do that when your dataset for a single sample is hundreds of megabytes; it becomes difficult to aggregate the visualizations across hundreds, thousands, or even hundreds of thousands, of specific samples.
Here is what a Graph looks like - http://gun.js.org/see/graphs.gif
Here is how an Ad-Hoc Mesh Network can deduplicate broadcast storms: http://gun.js.org/see/ad-hoc-mesh-network.gif (This is also the same principle that neurons use when firing signals!)
Here is what a Radix structure looks like: http://gun.js.org/see/radix.gif
Would love to see other visualizations by other people, please add links for me!
i = Math.random() * n-- | 0;
generates a value less than n.And
t = array[n];
array[n] = array[i];
array[i] = t;
is using a decremented n.You are being confused by the `n--` in the random selection.