Implementations of algorithms in JS