Datastructures & algorithms in JS