Implementing most of the Datadtructure and Algorithms in JS