JavaScript implementation of the popular algorithms