Data structures and algorithms in JavaScript