Essential Algorithms: The Bubble Sort

Written by joshuaecampbell | Published 2020/03/06
Tech Story Tags: algorithms | programming | time-complexity | complexity | arrays | python | essential-algorithms-series | beginners

TLDR Essential Algorithms: The Bubble Sort - a dead-simple, yet terribly inefficient, algorithm. It simply passes over an unsorted array, comparing one number to the one next to it. If the bigger number is on the left, then it swaps their places. It goes through each element individually until it's done with the array, and repeats that as many times as it needs to in order to sort the array. The reason it's called Bubble Sort is because it causes the largest unsorted number to bubble up to the top of the array on the first pass.via the TL;DR App

no story

Published by HackerNoon on 2020/03/06