sorting algorithm comparison sort exchange sort stable sort in-place quadratic time deterministic iterative