Skip to content

lukebro/sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sort 🌀

A library of simple dependency-free sorting algorithms.

All implementations of sort follow the same API but with different time complexities, choose your poison. 🍲

All sorts return a sorted array, original array stays untouched.

sort-insertion - an implementation of insertion sort

sort-bubble - an implementation of bubble sort

sort-selection - an implementation of selection sort

example of api

import sort from 'sort-bubble'

sort([6, 2, 5, 3], function (a, b) {
	return a > b
}) // returns [2, 3, 5, 6]

sort(['hello', 'how', 'are', 'you', '?'], function (a, b) {
	return a.length > b.length
}) // returns ['?', 'how', 'are', 'you', 'hello']

About

A library of simple dependency-free sorting algorithms

Resources

License

Stars

Watchers

Forks

Packages

No packages published