npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@irbisadm/super-sort

v0.0.5

Published

The Collection of O(n) and O(1) sorting algorithms

Downloads

14

Readme

Super Sort

The Collection of O(n) and O(1) sorting algorithms

Installation

npm install @irbisadm/super-sort --save
# or
yarn add @irbisadm/super-sort

Usage

If you have at least nine points of luck, you can use this library without any problems. With general sorting approach, you can sort any array of numbers with superSort function.

The superSort function will select random algorithm from the list of algorithms and sort your array.

import {superSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = await superSort(arr);

Algorithms

Bogo Sort

A terribly inefficient sort algorithm that repeatedly generates a random permutation of the items until the items are in order. It's best complexity is O(n). It's worst complexity is O(∞).

import {bogoSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = bogoSort(arr);

Bozo Sort

A terribly inefficient sort algorithm that randomly swaps items until they are in order. It's best complexity is O(n). It's worst complexity is O(∞).

import {bozoSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = bozoSort(arr);

Miracle Sort

A terribly inefficient sort algorithm that sorts the array by mirraculously putting the items in order. It's best complexity is O(0). It's worst complexity is O(∞).

import {miracleSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = await miracleSort(arr);

Time Sort

A terribly inefficient sort algorithm that sorts the array by sleeping for the number of milliseconds proportional to each item in the array. It's best complexity is O(n). It's worst complexity is O(∞).

import {timeSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = await timeSort(arr);

Taco Sort

A terribly inefficient sort algorithm that sorts the array by eating tacos until the array is sorted. It's best complexity is O(n). It's worst complexity is O(n * 2^32n).

import {tacoSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = tacoSort(arr);

Stalin Sort

A terribly inefficient sort algorithm that sorts the array by removing items that are out of order. It's best complexity is O(1). It's worst complexity is O(1).

import {stalinSort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = stalinSort(arr);

Lucky Sort

Most efficient sort algorithm: if the array is already sorted, it will not perform any operations! It's best complexity is O(n). It's worst complexity is O(0).

import {luckySort} from '@irbisadm/super-sort';

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const sorted = luckySort(arr);