Popular algorithms written in JavaScript