Basic data structures and algorithms implemented in JavaScript