Which Sorting Algorithm Should I Use? It depends. Each algorithm comes with its own set of pros and cons. Quicksort is a good default choice. It tends to be fast in practice, and with some small tweaks its dreaded worst-case time complexity becomes very unlikely. A tried and true favorite. Heapsort is a good choice if you can't tolerate a worst-case time complexity of or need low space costs. The
![Sorting algorithm reference, for coding interviews and computer science classes | Interview Cake](https://cdn-ak-scissors.b.st-hatena.com/image/square/5b43daa79eb566f39671f8a444769434435efe41/height=288;version=1;width=512/https%3A%2F%2Fwww.interviewcake.com%2Fstatic%2Fimages%2Fcake_white_on_blue_600_600_unrounded.png%3Fbust%3D210)