Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Shakersort vs. Quicksort

Loading...

Sign in or sign up now!
26,198
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 30, 2008

Shakersort vs. Quicksort

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Top Comments

  • Quicksort's quick, yeah yeah yeah!

  • @dented42 Yes. Shakersort is bidirectional bubblesort.

see all

All Comments (16)

Sign In or Sign Up now to post a comment!
  • @BushHatesMe I love replying to 2 year old comments too!

  • @Mank25 It's not slow,no no no!

  • @blauhuden111

    I just wrote a quicksort, it is extremely easy to avoid O(n^2) perf on presorted, or reverse sorted arrays.

    Only the most naive implementations will behave that way.

    Also, memory usage should be controlled by using a stack to eliminate recursion overhead and modifying the algorithm to be an in place sort instead of using 2 separate arrays for the high and low values.

    You are correct that the basic recursive quicksort algorithm will behave badly in this case though.

  • @spechtbert No really, quicksort uses a lot of memory when fed a fully-sorted or mostly-sorted array. Look it up. quicksort has a O(n^2) if it's sorting a presorted array.

  • @T0B0KKE sure.

  • @spechtbert It's the truth.

  • @T0B0KKE rofl.

  • this animation is cool^^

  • quicksort sucks if the data is already close to being sorted... and it uses loads of memory.

  • If you want interesting sorts, look into Smoothsort.

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more