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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Quotient Remainder Theorem
- Comparison among Bubble Sort, Selection Sort and Insertion Sort
- Chinese Remainder Theorem | Set 2 (Inverse Modulo based Implementation)
- Remainder with 7 for large numbers
- Program to find remainder without using modulo or % operator
- Using Chinese Remainder Theorem to Combine Modular equations
- Find remainder of array multiplication divided by n
- Generate Array whose sum of all K-size subarrays divided by N leaves remainder X
- Find N % 4 (Remainder with 4) for a large value of N
- Maximum frequency of a remainder modulo 2i
- Maximum possible remainder when an element is divided by other element in the array
- Check if the remainder of N-1 factorial when divided by N is N-1 or not
- Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?
- Odd-Even Sort / Brick Sort
- Bucket Sort To Sort an Array with Negative Numbers
- Sort all even numbers in ascending order and then sort all odd numbers in descending order
- Serial Sort v/s Parallel Sort in Java
- Program to sort an array of strings using Selection Sort
- C/C++ Program for Odd-Even Sort / Brick Sort
- Java 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 email@example.com. 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.