Back to All Algorithms
Pigeonhole Sort
Category: Sorting | Time: O(n + N) | Space: O(N)
Visualization
Visual representation of the data structure
Enter an algorithm and input to start visualization.
About Pigeonhole Sort

A sorting algorithm that is suitable for sorting lists of elements where the number of elements and the number of possible key values are approximately the same. It requires knowing the range of the values in advance.

Code Editor
The code is for reference. Editing it won't affect the visualization.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Frequently Asked Questions
About Pigeonhole Sort