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

ความคิดเห็น • 10

  • @kabuuu_voky
    @kabuuu_voky 4 หลายเดือนก่อน +1

    Interesting topic and nice video. Thank you for doing it

    • @CodeSlate
      @CodeSlate  4 หลายเดือนก่อน

      Glad you liked it! and thanks for watching

  • @mesfinhaftu6206
    @mesfinhaftu6206 13 วันที่ผ่านมา

    Brilliant video, however it is better if you add pseudo code or fragment code.

  • @hari-fi3yt
    @hari-fi3yt 3 หลายเดือนก่อน

    this is so cool bro i appreciate the animation

    • @CodeSlate
      @CodeSlate  3 หลายเดือนก่อน

      Thanks, I worked hard on it!

  • @mhmm666
    @mhmm666 หลายเดือนก่อน

    this was super helpful T^T thank you

    • @CodeSlate
      @CodeSlate  หลายเดือนก่อน +1

      Glad to help! And thanks for watching

  • @kobipy
    @kobipy 4 หลายเดือนก่อน +1

    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 ?

    • @CodeSlate
      @CodeSlate  4 หลายเดือนก่อน +3

      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.

    • @kobipy
      @kobipy 4 หลายเดือนก่อน +1

      @@CodeSlate Thanks for your answer !
      I will give it a try !
      Your efforts are definitely worth it, cause the reading is much more confortable.