Skip to content

jasonheecs/js-sorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Algorithms in Javascript

Build Status Coverage Status

A package containing implementations of various sorting algorithms in Javascript. This project is mainly a learning exercise and personal refresher on the common CS sorting algos, in addition to playing around with test coverage reports with coveralls

Installation

npm install @jasonheecs/js-sorting --save

Usage

    var {selectionSort} = require('@jasonheecs/js-sorting');
    var {bubbleSort} = require('@jasonheecs/js-sorting');
    var {insertionSort} = require('@jasonheecs/js-sorting');
    var {mergeSort} = require('@jasonheecs/js-sorting');
    var {quickSort} = require('@jasonheecs/js-sorting');

    var items = [5, 2, 1, 3, 6, 4];

    console.log(selectionSort(items));
    console.log(bubbleSort(items));
    console.log(insertionSort(items));
    console.log(mergeSort(items));
    console.log(quickSort(items));

Running unit tests

npm test

To run a specific test file, you can use an extra -- to pass the filename through:
npm test -- test/bubble-sort-test.js

License

MIT

About

An npm package containing implementations of various sorting algorithms in Javascript.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy