Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drop-merge-sort

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drop-merge-sort

Drop-merge sorting algorithm

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

js-drop-merge-sort Build Status

This is a javascript implementation of drop-merge sort algorithm, originally seen on: https://github.com/emilk/drop-merge-sort

##Installation

npm install drop-merge-sort

###Usage

###Example

var dmsort = require('drop-merge-sort');

var compareFunction = function(elem1, elem2) {
    return elem1 - elem2;// asc sort
};

var array = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];

array = dmsort(array, compareFunction);//desc sort

console.log(array);

##API

####dmsort(array, [compareFunction])

  • array: object like array
  • compareFunction(elem1, elem2): function for comparing two elem of iterable
    • Optional, if not given, will use : elem1 - elem2

Quicksort and Mergesort used in here are taken from https://github.com/mgechev/javascript-algorithms

Go there for details on the algorithm itself.

##Benchmarks Benchmark of sorting 1M integers Speedup over fastest competitor for 1M integers Benchmark of sorting 100k 100-byte strings Speedup over fastest competitor for 100k 100-byte strings

Keywords

FAQs

Package last updated on 10 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc