Data-Structrues and algorithms with JavaScript