Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/randhir200/new-sorting-algorithm
- Owner: Randhir200
- Created: 2022-04-28T05:22:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-28T14:26:06.000Z (over 2 years ago)
- Last Synced: 2024-11-06T03:46:56.504Z (about 2 months ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files: