33 comments

[ 3.2 ms ] story [ 78.0 ms ] thread
nice collection of things to study in one place. Any other similar..?
Lots of really interesting things here. The most valuable is definitely having some reference implementations.
Some are interesting, but there's lots of mundane and generally boring stuff too, e.g. [1]

[1] http://www.keithschwarz.com/interesting/code/?dir=argmax

Wow, what a sad place has HN become that this kind of comment is getting upvoted. There are tons of interesting stuff in there, very exhaustively commented, and you say "some are interesting, lots are mundane" quoting a single goddamn example. Wouldn't linking the interesting ones be, like, more interesting? What a fucking weak attitude!
Have you looked at the link he provided?

IMHO it doesn't fit at all with the other things. You can implement In-Place Mergesort or one of its variants by studying Wikipedia. Or you can just look up a nice implementation from the OPs site and port it to your favorite language. That said, this argmin/argmax thing does absolutely not fit.

It's just ONE example, and if it's really the most interesting thing HN has to say on this (it was the top comment when I responded) then it's truly a sad state of affairs. Those btw are as much tutorials as they are "nice implementations", there are lots of things pointed out in the comments that you won't easily find on Wikipedia.
Bidirectional Map can be implemented in less than 20 lines (put, get, remove).
Nice and simple; I like it! Also, you just made every introductory CS teacher cringe, unless they import all of these into their cheating detection system.
Actually Keith Schwarz is an introductory CS teacher :-).
Under what license may I reuse those snippets -- or are they too short to provoke legal issues anyways?
From the page:

"If you're interested in using any of this code in your applications, feel free to do so! You don't need to cite me or this website as a source, though I would appreciate it if you did. However, please don't plagiarize the code here by claiming authorship - that would just be dishonest. I also caution you that while I'm fairly confident that the code on this site is correct, I haven't mercilessly tested every line, and so there may be a lurking bug or two here."

Fantastic list. A great way to supplement the theory from CLRS, etc.
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)