3 ms·
I have an amusing archaeological anecdote about the bubble sort. Around 1990, on my first real job out of college, I was assigned about 100K lines of C code to
by tmoertel 8y ago
I have an amusing archaeological anecdote about the bubble sort.
Around 1990, on my first real job out of college, I was assigned about 100K lines of C code to maintain. I was told that it had problems scaling up to larger networks (it was a network mapping system).
While going through the code, I discovered that it contained a bubble sort that had been commented out. The comments said that it had been replaced with hand-rolled sorting logic in 68K assembly for "additional speed."
So I found the assembly code for the new sorting logic. It was also a bubble sort!
In disbelief, I replaced all this nonsense with a call to the standard library's `qsort` function. The scaling problems disappeared :-)
- gnulinux 8y agoSaved this quote to show to my future data structures students. Thanks.