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
- Find remainder of array multiplication divided by n
- Using Chinese Remainder Theorem to Combine Modular equations
- Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?
- Chinese Remainder Theorem | Set 2 (Inverse Modulo based Implementation)
- Bucket Sort To Sort an Array with Negative Numbers
- Insertion sort to sort even and odd positioned elements in different orders
- Program to sort an array of strings using Selection Sort
- Serial Sort v/s Parallel Sort in Java
- Odd Even Transposition Sort / Brick Sort using pthreads
- Java Program for Odd-Even Sort / Brick Sort
- Quick Sort vs Merge 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.