Quotient – Remainder Sort is a non-comparison based sorting algorithm. Steps to perform Quotient – Remainder sort as described below :
- Find MIN and MAX of the array.
- Create an ROW*COL matrix consisting of 0s, where ROW = MIN and COL = MAX/MIN + 1
- For each element in input array, calculate quotient and remainder and store in matrix[quotient][remainder]
- For each element in matrix, if element != 0, append element to sorted array
Input : 2 5 3 7 4 8 MAX = 8, MIN = 2, ROW = 4, COL 2 matrix : 2 3 4 5 0 7 8 0 Output : 2 3 4 5 7 8
Initial Array : 5 3 7 4 8 2 6 Maximum Element found is : 8 Minimum Element found is : 2 Array after sorting : 2 3 4 5 6 7 8
Abul Hasnat, Tanima Bhattacharyya, Atanu Dey, Santanu Halder and Debotosh Bhattachajee, 2017. A Novel Soring Algorithm using Quotient and Remainder,
J. Eng. Applied Sci, 12 (Special Issue 7): 8016-8020, 2017, ISSN : 1816-949X
- Comparison among Bubble Sort, Selection Sort and Insertion Sort
- Find N % 4 (Remainder with 4) for a large value of N
- Remainder with 7 for large numbers
- Program to find remainder without using modulo or % operator
- Using Chinese Remainder Theorem to Combine Modular equations
- Chinese Remainder Theorem | Set 2 (Inverse Modulo based Implementation)
- Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?
- Insertion sort to sort even and odd positioned elements in different orders
- Bucket Sort To Sort an Array with Negative Numbers
- Program to sort an array of strings using Selection Sort
- Java Program for Odd-Even Sort / Brick Sort
- Serial Sort v/s Parallel Sort in Java
- Odd Even Transposition Sort / Brick Sort using pthreads
- Quick Sort vs Merge Sort
- C/C++ Program for Odd-Even Sort / Brick Sort
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.