bubblesort-algorithm

bubble sort

Usage no npm install needed!

<script type="module">
  import bubblesortAlgorithm from 'https://cdn.skypack.dev/bubblesort-algorithm';
</script>

README

Bubble Sort

Bubble Sort is a simple algorithm. It works by checking each item in the list that is going to be ordered with the next one, swapping them if they are in the wrong order.

Install Package:

$ npm install bubblesort-algorithm

How it Works?:

Function receives a disordered Array:
Ej: [1, 9, 5, 2, 10, 6, 3, 7, 8, 4]

const bubbleSort = require("bubblesort-algorithm");

let array = [1, 9, 5, 2, 10, 6, 3, 7, 8, 4];

bubbleSort(array);
console.log(array);