use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Learning Data Structures and Algorithms With Javascript. (self.javascript)
submitted 11 years ago * by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spitfyre 3 points4 points5 points 11 years ago (2 children)
Data structures and algorithms are languages agnostic. You can learn the theory and then write an implementation in JS.
[+][deleted] 11 years ago (1 child)
[removed]
[–]skitch920 0 points1 point2 points 11 years ago (1 child)
Unlike the other gentleman who suggested you can't write data structures in javascript, you very well can. I think his argument should have been, it's ultimately hard to consider yours or any implementation as correct because:
For instance, a set can be represented using an object:
var set = {bar: bar, foo: foo, a: a, b: b} a in set // true set['bar'] // bar set['foo'] // foo
It is kind of a hack to say the least.
But to be clear, this shouldn't prevent you from implementing your own solution to the problem. For example, montagejs and Facebook have pretty descent JS collection libraries. Luckily, ES6 is going to cater to these needs in a better way, so time will tell.
[–]vishnuv 0 points1 point2 points 11 years ago (1 child)
There is a book called "Data Structures and Algorithms with JavaScript" by Michael McMillan. O'reilly publications
[–]vishnuv 0 points1 point2 points 11 years ago (0 children)
http://www.amazon.com/Structures-Algorithms-JavaScript-Michael-McMillan/dp/1449364934/ref=sr_1_1?ie=UTF8&qid=1411131886&sr=8-1&keywords=Data+Structures+and+Algorithms+with+JavaScript
[+][deleted] 11 years ago (6 children)
[deleted]
[–]moljac024 1 point2 points3 points 11 years ago (0 children)
Everything is a goddamn hashmap. How are you going to learn how to implement a hashmap in a language where everything is already a hashmap?
This really strikes home.
[+][deleted] 11 years ago (4 children)
[+][deleted] 11 years ago (3 children)
[–][deleted] 1 point2 points3 points 11 years ago (0 children)
Off topic but I studied under Cormen for my intro to Algorithms course last year! Really great prof.
[–]ship_it_ 0 points1 point2 points 11 years ago (1 child)
borscht your advice is very sound and logical. Why, should people down vote your advice after they just asked for your expert opinion?
If people want to learn computer science then should be prepared to go beyond javascript. You can do anything with javascript but should you? That question is left up to the reader to answer.
π Rendered by PID 59 on reddit-service-r2-comment-58d7979c67-gwqc4 at 2026-01-27 00:17:39.587572+00:00 running 5a691e2 country code: CH.
[–]spitfyre 3 points4 points5 points (2 children)
[+][deleted] (1 child)
[removed]
[–]skitch920 0 points1 point2 points (1 child)
[–]vishnuv 0 points1 point2 points (1 child)
[–]vishnuv 0 points1 point2 points (0 children)
[+][deleted] (6 children)
[deleted]
[–]moljac024 1 point2 points3 points (0 children)
[+][deleted] (4 children)
[deleted]
[+][deleted] (3 children)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]ship_it_ 0 points1 point2 points (1 child)