Skip navigation
which sorting algorithm keeps up with constant random updates best?
0:00 / 0:55

which sorting algorithm keeps up with constant random updates best?

Matt Henderson

@matthen281K followers

Visit on X
533 likesDownloadOriginal post

82,694 views

which sorting algorithm keeps up with constant random updates best? at every second in this animation, a random item is taken (blue), and its value is changed

9 Comments

Comments from the original post on X (Twitter)

  • Urban Coyote's profile picture

    @skip_strike

    Stop it you’re hurting them 😭

    126 likes

  • Nick Sweeting's profile picture

    @thesquashSH

    How do I know if it's working without sound?

    37 likes

  • 🍁 @notcatra.bsky.social 🍁's profile picture

    @notcatra

    Rather than using a sorting algorithm, which will have to move on average N/2 elements to accommodate a changed value, isn’t it better just to use either a heap or a self-balancing binary tree? These are data structures specifically designed for this task

    11 likes

  • Jos van der Westhuizen's profile picture

    @JosvdWest

    stumbled on this pretty cool gif of bubble sort

    8 likes

  • Gustavo W. Lopes's profile picture

    @MTGRUG

    Well, that's one way to make merge and quicksort misearable.

    6 likes

  • King Arthur I's profile picture

    @Kingarthur_I

    this is inhumane

    5 likes

  • Ryan Moulton's profile picture

    @moultano

    Bubble sort would come out much better if you did alternating sweeps in opposite directions.

    4 likes

  • D4's profile picture

    @d4

    Knowing the obsession with randomness in the complexity community, I'm sure there are many un-readable papers on this.

    3 likes

  • MetaGlitch's profile picture

    @MetaGlitch

    Special requirements may warrant special algorithms. How about an alternating bubble sort that switches between walking upwards and downwards the array?

    2 likes