Coding Challenge #114: Bubble Sort Visualization
Yes, sorting numbers can be fun! In this challenge I attempt to implement the "bubble sort" algorithm in Processing (Java) and visualize the process itself with animated lines. Code: https://thecodingtrain.com/challenges/114-bubble-sort-visualization
(π€π€π€Correction: At 3:53 I incorrectly state that N's growth is exponential, I should have said "quadratic" or "polynomial".)
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/3HVrL9m36
π₯ Previous video: https://youtu.be/XE3YDVdQSPo?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/OMoVcohRgZA?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
π Visualizing Algorithms: https://bost.ocks.org/mike/algorithms/
Live Stream Archive:
π΄ Coding Train Live 149: https://youtu.be/mfOL2RIyk2c?t=12543s
Related Coding Challenges:
π #47 Pixel Sorting in Processing: https://youtu.be/JUDYkxU6J0o
π #143 Quicksort Visualization: https://youtu.be/eqo2LxRADhU
Timestamps:
0:00 Introducing today's topic
1:50 What is a bubble sort?
4:10 Visualizing the array
6:17 Write the sorting algorithm
8:19 Write the swap function
9:30 Animate the sort
12:52 Speed up the sorting
16:41 Conclusion and suggestions
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://thecodingtrain.com/discord
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: https://p5js.org
π p5.js Web Editor: https://editor.p5js.org/
π Processing: https://processing.org
π Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#bubblesortalgorithm #processing