instant-sort

The fastest sorting algorithm ever with the speed of O(1)

MIT License

Downloads
16
Stars
14

Instant Sort

The fastest sorting algorithm ever with the speed of O(1)

Installation

npm install instant-sort

Examples

const { sort } = require('instant-sort')
 
function isSorted(arr) {
  originalArr = arr.toString() 
  arr.sort(function(a,b){
    return a - b; 
  })

  return arr.toString() === originalArr;
}
 
const unsortedArray = [4, 1, 5, 2, 6, 9]
 
console.log(isSorted(unsortedArray)) // false
console.log(isSorted(sort(unsortedArray))) // true

TypeScript

Yes, this module is TypeScript-friendly! No need for DefinitelyTyped

const res = sort<Omit<IAnime, 'genres'>>([
  {
    name : {
      romaji: 'Toaru Kagaku no Railgun T',
      english: 'A Certain Scientific Railgun T',
      native: 'T',
    },
  },
  {
    name : {
      romaji: 'Itai no wa Iya nanode Bougyo-Ryoku ni Kyokufuri Shitai to Omoimasu',
      english: `BOFURI: I Don't Want to Get Hurt, so I'll Max Out My Defense.`,
      native: ''
    },
  },
])

console.log(res) // Should return sorted array

Contributing

We welcome all contributions by sending PR to this repository.

Need Help ?

If you need help with anything, here're following methods:

Create an Issue

If you have something you want to discuss in detail, or have hit an issue which you believe others will also have in deployment or development of the system, opening an issue is the best way to get help. It creates a permanent resource for others wishing to contribute to conversation.

Donations

If you like my project, please supporting me by buying some coffee

Package Rankings
Top 16.85% on Npmjs.org
Badges
Extracted from project README
npm npm bundle size