2
0
u/SmartAsFart Jan 08 '20
Would be better if you did each swap in the algorithm as a separate step. This doesn't really tell you much.
4
u/NbdySpcl_00 Jan 08 '20
This is tricky. The painful and slowness of the iterative swaps is the heart of really understanding why bubble sort is (1) easy, and (2) inefficient in most cases.
But, trying to draw each swap would complicate the diagram. You'd lose the sense the other essential characteristics of bubble sort -- that each iteration ideally places the nth-to-last element.
I'm not sure why there's no ribbon between start and iteration 1. I like the gap between the last and penultimate columns. But the order seems the same? It seems to compare the result of the sort with the intended consequence. But columns 0 and 1 are different. I think the left two columns should match in the same way as the right two columns.
7
u/elktrxrrr Jan 08 '20
awesome! is something like this available for other sorting algorithms as well?