r/Python • • Jan 08 '20

Visualizing Bubble Sort

Post image
2.1k Upvotes

73 comments sorted by

View all comments

3

u/mac-0 Jan 08 '20

Why are some lines curved and some straight?

4

u/thebuffed Jan 08 '20 edited Jan 08 '20

The connecting line always "curves" through points, so when the points are in an actual line, the connecting line follows it and it's straight. It's very similar to control points in a Bezier Curve: https://en.wikipedia.org/wiki/B%C3%A9zier_curve