5 ms·
The Archive of Interesting Code
- krat0sprakhar 13y agoShameless plug : I have a few of these ported to Python as well - https://github.com/prakhar1989/Algorithms https://github.com/prakhar1989/Algorithms
- txet 13y agonice collection of things to study in one place. Any other similar..?
- gtani 13y agohttp://teachingtree.co/cs http://teachingtree.co/cs http://www.geeksforgeeks.org/ http://www.geeksforgeeks.org/ http://aggregate.org/MAGIC/ http://aggregate.org/MAGIC/ http://www.algorithmatic.com/browse?q=sort:latest http://www.algorithmatic.com/browse?q=sort:latest
- barbs 13y agoIt reminds me a bit of this site: http://rosettacode.org/wiki/Rosetta_Code http://rosettacode.org/wiki/Rosetta_Code
- rttlesnke 13y agoThis one is nice: http://xlinux.nist.gov/dads/ http://xlinux.nist.gov/dads/
- abecedarius 13y agohttp://programmingpraxis.com/contents/chron/ http://programmingpraxis.com/contents/chron/
- CountHackulus 13y agoLots of really interesting things here. The most valuable is definitely having some reference implementations.
- abcd_f 13y agoSome 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 http://www.keithschwarz.com/interesting/code/?dir=argmax
- stiff 13y agoWow, 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!
- eps 13y agoTo each his own. For some splay trees is a revelation, for others - it's Algorithms 101.
- stiff 13y agoEuclid's Algorithm is certainly Algorithms 101, his discussion of it - far from it: http://www.keithschwarz.com/interesting/code/?dir=euclid http://www.keithschwarz.com/interesting/code/?dir=euclid
- blablabla123 13y agoHave 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.
- stiff 13y agoIt'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.
- webo 13y agoBidirectional Map can be implemented in less than 20 lines (put, get, remove).
- tlarkworthy 13y agoUm, pick me too! Persistent Red-Black Tree http://wiki.edinburghhacklab.com/persistentredblacktreeset http://wiki.edinburghhacklab.com/persistentredblacktreeset
- wfunction 13y agoI was so happy to see the in-place merge algorithm! Does anyone know if there is an implementation of the (supposedly) faster version, which was published in this later paper? http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.134.2842 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.134....
- hoka 13y agoNice 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.
- ddp26 13y agoActually Keith Schwarz is an introductory CS teacher :-).
- bigfoot 13y agoUnder what license may I reuse those snippets -- or are they too short to provoke legal issues anyways?
- dsuth 13y agoFrom 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."
- optiminimalist 13y agoFantastic list. A great way to supplement the theory from CLRS, etc.
- pathikrit 13y agoI am building a Scala one here: https://github.com/pathikrit/scalgos https://github.com/pathikrit/scalgos
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]