Javascript Algorithms — Bubble Sort
The next algorithm in the Javascript Algorithms series is bubble sort. Like insertion sort, bubble sort is a comparison algorithm and runs in O(n²) time, making it an inefficient algorithm for larger lists. As we saw in the last post about insertion sort, often times in practice quadratic sorting algorithms will outperform more advanced algorithms on very small lists. Bubble sort, while still holding true to that principal, is…