JavaScript implementation of different algorithms.