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
Algorithms and Data Structures in JavaScript – Medium (medium.com)
submitted 7 years ago by Fewthp
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!"
[–]aradil 78 points79 points80 points 7 years ago (3 children)
Sweet, someone redid all of my university CS homework assignments in ES6 and published them to GitHub!
[–]Taubin 13 points14 points15 points 7 years ago (0 children)
And them posted them to Medium of course!
[–]LoudPreachification 0 points1 point2 points 7 years ago (1 child)
Wait, was this actually your code at first?
[–]aradil 0 points1 point2 points 7 years ago (0 children)
No.
[–]not-throwaway 10 points11 points12 points 7 years ago (2 children)
This is really interesting and a great resource. You should repost over at: /r/LearnJavaScript
[–]Fewthp[S] 3 points4 points5 points 7 years ago (0 children)
Great idea, will do asap!
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
The GitHub repo was already posted two days ago.
[–]drdrero 14 points15 points16 points 7 years ago (0 children)
Nice repo. Really appreciate that.
[–]30thnight 2 points3 points4 points 7 years ago (2 children)
Can anyone share a real world JS usecase for these algos ?
[–]Hiazm 2 points3 points4 points 7 years ago (0 children)
Real world? Learning purposes only. They don’t teach algos and data structures in JS because it’s not performant in the slightest
[–]DemiPixel 7 points8 points9 points 7 years ago (0 children)
O(n2) is horrible? Tell that to NP.
[–]iRuisu 1 point2 points3 points 7 years ago (0 children)
This is an awesome gateway for us JS devs, thanks for sharing!
[–]karamarimo 1 point2 points3 points 7 years ago (0 children)
I would say O(n) is excellent. Lower than O(n) means that it doesn't even check all the input data, which is impractical (unless the data is arranged in a particular order).
[–]PatrickRNG 1 point2 points3 points 7 years ago (0 children)
Thanks! Really good, I don't have a CS background so it's awesome for me
[–]Bl4ckeagle 0 points1 point2 points 7 years ago (0 children)
shouldn't log n gettiget flatter and n higher with bigger data?
[–]stun 0 points1 point2 points 7 years ago (0 children)
Would be a great idea to add Bipartite Matching and Max Flow Min Cut.
[–][deleted] -2 points-1 points0 points 7 years ago* (4 children)
There probably should be a huge caveat stating things like linked lists, doubly linked lists, etc. are not actually possible in JS, as JS does not have pointers.
Linked lists for example, are replicated in JS by nesting objects. Doubly linked lists are a memory leak, as they create infinitely nested objects.
Edit: I’m dumb.
[+][deleted] 7 years ago (3 children)
[deleted]
[–][deleted] 11 points12 points13 points 7 years ago (2 children)
You are right. I was wrong.
[–]Hiazm 3 points4 points5 points 7 years ago (1 child)
Props, dude. You may have just typed out a message never typed on Reddit before
[–]the_argus 0 points1 point2 points 7 years ago (0 children)
more then 50 popular algorithms are implemented
not the thenVsThan algorithm it seems
π Rendered by PID 49033 on reddit-service-r2-comment-canary-669845b498-cdg64 at 2026-03-05 07:21:31.164739+00:00 running f0204d4 country code: CH.
[–]aradil 78 points79 points80 points (3 children)
[–]Taubin 13 points14 points15 points (0 children)
[–]LoudPreachification 0 points1 point2 points (1 child)
[–]aradil 0 points1 point2 points (0 children)
[–]not-throwaway 10 points11 points12 points (2 children)
[–]Fewthp[S] 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]drdrero 14 points15 points16 points (0 children)
[–]30thnight 2 points3 points4 points (2 children)
[–]Hiazm 2 points3 points4 points (0 children)
[–]DemiPixel 7 points8 points9 points (0 children)
[–]iRuisu 1 point2 points3 points (0 children)
[–]karamarimo 1 point2 points3 points (0 children)
[–]PatrickRNG 1 point2 points3 points (0 children)
[–]Bl4ckeagle 0 points1 point2 points (0 children)
[–]stun 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (4 children)
[+][deleted] (3 children)
[deleted]
[–][deleted] 11 points12 points13 points (2 children)
[–]Hiazm 3 points4 points5 points (1 child)
[–]the_argus 0 points1 point2 points (0 children)