2 ms·
If you really want to learn how to do this, and do it really really well, check out sglib: http://sglib.sourceforge.net/ http://sglib.sourceforge.net/ It's go
by zedshaw 16y ago
If you really want to learn how to do this, and do it really really well, check out sglib:
http://sglib.sourceforge.net/ http://sglib.sourceforge.net/
It's got nearly every data structure you can imagine, all implemented as CPP meta hackery. Brilliant.
- chancho 16y agoI used this library a while back, and it was nice at first, until I noticed that his quicksort always picked the first element as the pivot, which makes it O(n^2) on already-sorted input. Then I started second guessing everything, and when you do that with a library you may as well write it yourself without the CPP hackery. At least then the compiler errors will make sense and you can debug it. I went to go check out the code to see if this issue had been fixed, but the download link has gone bad. I mentioned this library on HN some years back, when I was still excited about it, and the reply I got was something like "No! Not that macro boneyard!" He was right.