Coding Challenge 114: Bubble Sort

Published: 27 August 2018
on channel: The Coding Train
448,357
9.3k

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...

(🤖🤖🤖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/s...

🎥 Previous video:    • Coding Challenge #113: 4D Hypercube (aka "...  
🎥 Next video:    • Coding Challenge #115: Snake Game Redux  
🎥 All videos:    • Coding Challenges  

References:
📓 Visualizing Algorithms: https://bost.ocks.org/mike/algorithms/

Live Stream Archive:
🔴 Coding Train Live 149:    • Coding Train Live #149: More ml5.js  

Related Coding Challenges:
🚂 #47 Pixel Sorting in Processing:    • Coding Challenge #47: Pixel Sorting in Pro...  
🚂 #143 Quicksort Visualization:    • Coding Challenge 143: Quicksort Visualization  

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/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 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-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#bubblesortalgorithm #processing


On this page of the site you can watch the video online Coding Challenge 114: Bubble Sort with a duration of hours minute second in good quality, which was uploaded by the user The Coding Train 27 August 2018, share the link with friends and acquaintances, this video has already been watched 448,357 times on youtube and it was liked by 9.3 thousand viewers. Enjoy your viewing!