馃殌 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 馃挭

Optimized bubble sort in JavaScript. Cocktail sort

Bubble sort algorithm doesn鈥檛 track the current state of the array. Even if it gets the fully sorted array as an input, the runtime will remain of the same O(n^2^) complexity....

February 21, 2021 路 5 min 路 Coderslang Master

Bubble sort in JavaScript

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order....

February 20, 2021 路 3 min 路 Coderslang Master

Algorithm complexity and efficiency

All algorithms have 2 main characteristics: Amount of required memory. Execution time. These two are used to compare algorithms with each other. Some algorithms are faster, but require more memory, while others are vice versa....

February 19, 2021 路 3 min 路 Coderslang Master