tap for sound

Top algorithm

Fast

Slow and simple

No comparing

Just for fun

Make video

Battle · 10 s

1080×1920 with sound, ready for TikTok, Reels and Shorts.

This one's a Pro video

It uses battle videos. Pro unlocks every look and sound, battle and multi-sort videos, and no watermark.

Secure checkout with Stripe · 14-day refund

Customize

Layout
ColoursRainbow
BackgroundMidnight
Glow100%
Size100%

Cycle Sort vs Selection Sort

Same 110 values, same shuffle, same speed. Selection Sort finishes first and turns gold: 6,097 operations to 16,802.

The numbers

Cycle operations
16,802
Selection operations
6,097
Cycle average
n²
Selection average
n²
Cycle worst
n²
Selection worst
n²

Cycle Sort

Cycle Sort writes every value directly to its final position, using the fewest possible writes. More on Cycle Sort.

Selection Sort

Selection Sort finds the smallest remaining value and swaps it to the front, again and again. More on Selection Sort.

FAQ

Which is faster, Cycle Sort or Selection Sort?

On this shuffle of 110 values, Selection Sort needed 6,097 operations and Cycle Sort needed 16,802, about 2.8× as many. On average Cycle Sort is n² and Selection Sort is n².

Which one is stable?

Neither is stable.

How is the race fair?

Both algorithms start from the same shuffle and run the same number of operations per frame. Every comparison, swap and write counts as one operation, so the one that needs fewer operations finishes first.