diff --git a/C++/PigeonholeSort.cpp b/C++/PigeonholeSort.cpp new file mode 100644 index 0000000..2297728 --- /dev/null +++ b/C++/PigeonholeSort.cpp @@ -0,0 +1,41 @@ +#include +#include +using namespace std; + +void pigeonhole_sort(int arr[],int n) +{ + int minm=arr[0],maxm=arr[0]; + for(int i=1;imaxm) + maxm=arr[i]; + } + int range=maxm-minm+1; + vectorholes[range]; + for(int i=0;i>n; + int arr[n]; + cout<<"Enter elements of the array : "; + for(int i=0;i>arr[i]; + pigeonhole_sort(arr,n); + cout<<"Sorted array is : "< [`Insertion Sort`](C++/InsertionSort.cpp) [`Merge Sort`](C++/MergeSort.cpp) [`Quick Sort`](C++/QuickSort.cpp)
[`Selection Sort`](C++/SelectionSort.cpp) [`Shell Sort`](C++/ShellSort.cpp) [`Binary Insertion Sort`](C++/BinaryInsertionSort.cpp)
[`Bucket Sort`](C++/BucketSort.cpp) [`Cycle Sort`](C++/cycleSort.cpp) [`K Way Merge Sort`](C++/)
[`Radix Sort`](C++/RadixSort.cpp) [`Tree Sort`](C++/treeSort.cpp) | +| C++ | [`Interchange Sort`](C++/InterchangeSort.cpp ) [`Bubble Sort`](C++/BubbleSort.cpp) [`Heap Sort`](C++/HeapSort.cpp)
[`Insertion Sort`](C++/InsertionSort.cpp) [`Merge Sort`](C++/MergeSort.cpp) [`Quick Sort`](C++/QuickSort.cpp)
[`Selection Sort`](C++/SelectionSort.cpp) [`Shell Sort`](C++/ShellSort.cpp) [`Binary Insertion Sort`](C++/BinaryInsertionSort.cpp)
[`Bucket Sort`](C++/BucketSort.cpp) [`Cycle Sort`](C++/cycleSort.cpp) [`K Way Merge Sort`](C++/)
[`Radix Sort`](C++/RadixSort.cpp) [`Tree Sort`](C++/treeSort.cpp) [`PigeonholeSort`](C++/PigeonholeSort.cpp) | | C | [`Bubble Sort`](C/BubbleSort.c) [`Insertion Sort`](C/InsertionSort.c) [`Merge Sort`](C/MergeSort.c)
[`Quick Sort`](C/QuickSort.c) [`Selection Sort`](C/SelectionSort.c) [`Bubble Sort #2`](C/Bubble-Sort.c)
[`Gnome Sort`](C/gnomesort.c) [`Heap Sort`](C/heapsort.c) [`Radix Sort`](C/radixsort.c)
[`Tree Sort`](C/treesort.c) | | C# | [`Bubble Sort`](C#/BubbleSort.cs) [`Binary Insertion Sort`](C#/BinaryInsertionSort.cs) [`Heap Sort`](C#/HeapSort.cs)
[`Insertion Sort`](C#/InsertionSort.cs) [`Merge Sort`](C#/MergeSort.cs) [`Quick Sort`](C#/QuickSort.cs)
[`Selection Sort`](C#/SelectionSort.cs) [`Shell Sort`](C#/ShellSort.cs) | | Go | [`Radix Sort`](Go/RadixSort.go) [`Bubble Sort`](Go/BubbleSort.go) [`Insertion Sort`](Go/InsertionSort.go)|