Channels ▼   Algorithm Improvement through Performance
Measurement: Part 4   STL stable_sort() function uses a buffered
Merge Sort algorithm, if it can allocate sufficient memory for a
temporary buffer, or Insertion Sort if it cannot [2]. Thus, STL
stable_sort() is not in-place, when it uses a buffered Merge
Sort. Stability of Intel's IPP Radix Sort is unknown. It may not
be possible to determine stability of an algorithm that sorts
only numbers, since stability is not necessary when sorting
arrays of numbers [1]. For instance, when the resulting sorted
array has two elements of the same value next to each other
(e.g. a[8] = 5 and a[9] = 5) it’s unknown which of the 5's
originally preceded the other value of 5.  The algorithm in
Listing 1 is stable. It processes the input array in order from
the smallest index to the largest. At each recursion level, the
algorithm moves the array elements from the source array in
order, and places them in order in the destination array. The
copy at the end is also stable. Ins