comparison-sorting / merge-sort

:dragon: Mergesort algorithm for JavaScript
https://aureooms.github.io/js-mergesort
GNU Affero General Public License v3.0
1 stars 0 forks source link
agpl algorithms javascript mergesort sorting-algorithms stable-sort stable-sorting worst-case

:dragon: @aureooms/js-mergesort


IDEA Instructions developed by Sándor P. Fekete and Sebastian Morr.

Mergesort library for JavaScript. See docs. Parent is aureooms/js-sort.

import * as array from '@aureooms/js-array' ;
import * as merging from '@aureooms/js-merging' ;
import * as mergesort from '@aureooms/js-mergesort' ;

const sort = mergesort.recursive( merging.tapemerge , array.copy ) ;

let data = [ /*...*/ ] ;
let a = data.slice();
let b = new Array(data.length) ;

import { increasing } from '@aureooms/js-compare' ;
sort(increasing, a, 0, a.length, b, 0, b.length) ;

import { issorted } from '@aureooms/js-sort' ;
issorted(increasing, b, 0, b.length) ; // true

License Version Build Dependencies Dev dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

:link: Links