pigeonhole sort Algorithm

Iterate over the pigeonhole array in order, and put components from non-empty pigeonholes back into the original array. Pigeonhole sorting is a sorting algorithm that is suitable for sorting lists of components where the number of components (N) and the length of the range of possible key values (N) are approximately the same.

pigeonhole sort source code, pseudocode and analysis