21 ms·
Obama: A Bubble Sort is the Wrong Way to Go
- edw519 19y agoI had 2 different users from the same client call me today that their system was too slow. (Had been running beautifully for years.) There were both trying to do the same thing - sort customer orders in product sequence on the executive dashboard. 300 records - what was the problem? 2 things: 1) It was an internal bubble sort I had written years ago. 2) They both selected a year's worth of data. Doh! I shoulda listened to Obama.
- foonamefoo 19y agoUnless you are doing hardcore systems programming, there is almost never a reason to write your own sort.
- cperciva 19y agoWhere's the C library function for "sort the N-byte records in the file named 'foo' which is too large to fit into RAM"?
- bayareaguy 19y agoPerhaps not in libc but on my freebsd box /usr/src/gnu/usr.bin/sort/sort.c delivers the goods if foo has newlines.
- foonamefoo 19y agosystem('sort filename');
- edw519 19y ago"almost never a reason to write your own sort" What about being drunk on New Year's Eve?
- ovi256 19y agoThat's... uh; that's hardly a reason for anything. Except hooking up with that hot little secretary you had a crush on forever.
- cduan 19y agohttp://youtube.com/watch?v=k4RRi_ntQc8 http://youtube.com/watch?v=k4RRi_ntQc8
- daniel-cussen 19y agoThat's a nice paywall they have set up.
- apathy 19y agoHuh? The NYtimes is completely free with a login. Use BugMeNot if you have to. They quit charging for TimesSelect some time ago; now all of their archives for 150+ years are freely available online.
- simianstyle 19y agoohhhhhhhhhhhhhhhhbama :)
- tlrobinson 19y agohttp://news.ycombinator.com/item?id=85461 http://news.ycombinator.com/item?id=85461
- ivankirigin 19y agoThis is the sorting algorithm I like best: data.sort()