The Big O Cheatsheet

Take a quick peek what complexity an algorithm has.

Doing so not only helps to avoid performance surprises but also will make you think about what you‘ re trying to achieve.

In more than one way using a „slower“ algorithm can make sense. Especially when „using“ means you’re actually writing the code yourself.

One point is code complexity and therefore the risk of implementation errors and maintainability.

Another constraint you might want to keep an eye out for, are additional requirements. Merge sort for example requires more memory than bubble sort. Whether this is something to consider definitely depends on your requirements.