Stable sort

A sort that preserves the original relative order of elements that compare equal.