Skip to content

Instantly share code, notes, and snippets.

@facug91
Last active January 6, 2024 22:02
Show Gist options
  • Save facug91/65554fb3c8b49386329db5ffdaef2b0f to your computer and use it in GitHub Desktop.
Save facug91/65554fb3c8b49386329db5ffdaef2b0f to your computer and use it in GitHub Desktop.
Benchmark comparison of sorting algorithms in C++
Algorithm n=50000 Sorted asc n=50000 Sorted desc n=50000 random
Bubble Sort ~1160 ms ~1509 ms ~3177 ms
Selection Sort ~645 ms ~642 ms ~646 ms
Stable Selection Sort ~1159 ms ~1995 ms ~1915 ms
Insertion Sort ~0.052 ms ~1515 ms ~757 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment