Quicksort: How to choose the pivot (Animated!)
ฝัง
- เผยแพร่เมื่อ 14 พ.ย. 2024
- If you don't understand pivot selection in depth, you don't know quicksort. Using colorful sorting animations, this video explains the advantages and disadvantages of multiple methods of choosing pivots in the quicksort algorithm. It's a great way to review quicksort for those who have seen it before or to go more in depth for those learning quicksort for the first time now. Thinking through the various pivot selection strategies will help you prepare for job interviews or help you study for a DSA/data structures and algorithms course. As always, colorful sorting animations (written in Python/ManimCE) accompany thorough explanations.
References:
Engineering a Sort Function (info on pseudomedian of 9/Tukey's ninther):
gallium.inria....
Details on proof of correctness for quicksort: See CLRS algorithms Chapter 7
Use of special algorithm to find median each time (MIT lecture, relevant info starts at about 1:02:30):
• 6. Randomization: Matr...
Stack overflow post with median of 3 killer:
stackoverflow....
Paper on introsort and median-of-3-killer:
webpages.charl...
Interesting topic and nice video. Thank you for doing it
Glad you liked it! and thanks for watching
Brilliant video, however it is better if you add pseudo code or fragment code.
this is so cool bro i appreciate the animation
Thanks, I worked hard on it!
this was super helpful T^T thank you
Glad to help! And thanks for watching
Good animations !
Is it done with Manim ?
I like the way the text is displayed. Are you using "Write(...)" ? And which font are you using ?
Thank you so much! It was honestly really annoying to figure out how to animate the text so smoothly. I am glad you noticed, because it took me a while to get it to look right.
Yes, it's done with ManimCE. I use Create() to make the text, combined with some code to get the timings to match my voice more closely. The font is called "Ubuntu Mono", though I feel like there are lots of other coding fonts (all monospaced) that look pretty much the same.
@@CodeSlate Thanks for your answer !
I will give it a try !
Your efforts are definitely worth it, cause the reading is much more confortable.