Question: language: c programming using qsort() A modefied version of a popular question: Sort! Sort!! and Sort!!! - You will be given N positive numbers and


A modefied version of a popular question: Sort! Sort!! and Sort!!! - You will be given N positive numbers and a positive integer M. You will have to sort the N numbers in ascending order of their modulo M value. If there is a tie between an odd number and an even number (that is their modulo M value is the same) then the odd number will precede the even number. If there is a tie between two odd numbers (that is their modulo M value is the same) then the larger odd number will precede the smaller odd number and if there is a tie between two even numbers (that is their modulo M value is the same) then the smaller even number will precede the larger even number. Input : A set starts with two integers N(0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
