This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bubble sorting algorithm in JavaScript. | |
* | |
* Here i'm using arrow function and ES6, but you can use native function and ES5 instead. | |
* | |
* @param {array} arr Unsorted Array | |
* @return {array} | |
*/ | |
const bubbleSort = arr => { | |
let swapped; |
NewerOlder