Optimized bubble sort in JavaScript. Cocktail sort
Bubble sort algorithm doesn’t 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. (more…)
Read more »The word “Prototype” in JavaScript doesn’t mean an initial version that was quickly put together. It refers to a system instead. Read more