Assorted sorting algorithms in C++, Python, and Javascript