Bubble Sort

 let finished = false
while(!finished) {
finished = true
for(let i =1; i < array.length; i++){
if(array[i -1] > array[i]) {
finished = false
let temp = array[i -1]
array[i-1] = array[i]
array[i] = temp
}
}
}

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Kotlin Interview Questions for Android developers

Solid Explorer File Manager APK v2.8.19 (MOD Pro Unlocked)

Brahma OS September Report

Joule — Use case examples

Domain-Driven Design Approach in Laravel

https://gist.github.com/zhanang19/731ccfa743cf3f0ca1b6bc5e2a40f9e2

How to create a read-only MySQL user?

How to secure and manage secrets using Google Cloud KMS

Google AppEngine with Gradle & IntelliJ

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nerly Ton

Nerly Ton

More from Medium

How To Raise Democratic Demand To Curb Air Pollution?

Teaching a Hybrid class in a University setting

How to configure Appium Maven Project 🧐

SorareData now uses Opta to provide real-time SO5 scoring & more