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

Sorting is the process of arranging a sequence of objects in a particular order. You can sort any entities that can be compared. Imagine an online store. You enter your query into the search bar and you get a list of results....

February 20, 2021 路 2 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