Sorts
different sorting algorithms implemented using generator functions
- Bubble
- Selection
- Insertion
Installation
npm i @aryan02420/sorts
Usage
const {Bubble} = require('@aryan02420/sorts')
let array = [2,5,3,7,1]
let sort = Bubble(array)
console.log(sort.next().value) // [ 2, 3, 5, 7, 1 ]
console.log(sort.next().value) // [ 2, 3, 5, 1, 7 ]