You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was studying algorithms and data structures and came across this visualization for counting the number of inversions in an array (elements out of sorted order, basically):
1 2 3 4 5 6
| \ / \ / |
| \/ \ |
| /\ / \ |
| / \ / \ |
| | \ / | |
| | / | |
| | / \ | |
1 3 5 2 4 6
The number of inversion is equal to the number of intersections! Looks much cooler with straight lines (and when drawn by hand). Even though the concept is pretty simple, I think it becomes even clearer with this visualization, as crossing lines indicate deviations from the equilibrium state where all lines are vertical. Brilliant communication of variation, in my opinion.
edit: seems like this is like a rotated bumps chart