Versatile sort algorithm implementations.