Tutorial by Examples

Pigeonhole Sort is a sorting algorithm that is suitable for sorting lists of elements where the number of elements (n) and the number of possible key values (N) are approximately the same. It requires O(n + Range) time where n is number of elements in input array and ‘Range’ is number of possible va...
public class PigeonholeSort { private static void SortPigeonhole(int[] input, int n) { int min = input[0], max = input[n]; for (int i = 1; i < n; i++) { if (input[i] < min) min = input[i]; if (input[i] > max) max = input[i]; ...

Page 1 of 1