Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/randhir200/new-sorting-algorithm

Hassan has discovered his own sorting algorithm. The algorithm has following conditions: 1. Given an integer k, sort the values in the array according to their modulo with k. That is, if there are two integers a and b, and a%k < b%k, then a would come before b in the sorted array. 2. If a%k = b%k, then the integer which comes first in the given array remains first in the sorted array. Your task is to write a program that sorts the given array as per above mentioned condition and print the sorted array.
https://github.com/randhir200/new-sorting-algorithm

Last synced: 1 day ago
JSON representation

Hassan has discovered his own sorting algorithm. The algorithm has following conditions: 1. Given an integer k, sort the values in the array according to their modulo with k. That is, if there are two integers a and b, and a%k < b%k, then a would come before b in the sorted array. 2. If a%k = b%k, then the integer which comes first in the given array remains first in the sorted array. Your task is to write a program that sorts the given array as per above mentioned condition and print the sorted array.

Awesome Lists containing this project