Two elements having the same value appear in the same order in the sorted sequence as they did in the input sequence.
Counting Sort is a Stable Sort.
Array A:
Array B:
If we change line from