Hacker News new | past | comments | ask | show | jobs | submit login
Obama: A Bubble Sort is the Wrong Way to Go (nytimes.com)
14 points by edw519 on Feb 16, 2008 | hide | past | favorite | 13 comments



I 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.


Unless you are doing hardcore systems programming, there is almost never a reason to write your own sort.


"almost never a reason to write your own sort"

What about being drunk on New Year's Eve?


That's... uh; that's hardly a reason for anything. Except hooking up with that hot little secretary you had a crush on forever.


Where's the C library function for "sort the N-byte records in the file named 'foo' which is too large to fit into RAM"?


Perhaps not in libc but on my freebsd box /usr/src/gnu/usr.bin/sort/sort.c delivers the goods if foo has newlines.


system('sort filename');



This is the sorting algorithm I like best:

  data.sort()



That's a nice paywall they have set up.


Huh? 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.


ohhhhhhhhhhhhhhhhbama :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: