December 07, 2007

Algorithms

Earlier this week I was fairly pleased with myself for writing a reasonably elegant piece of code that takes a bunch of variously-sized chunks of data and works out how to efficiently and predictably squeeze them into the spare bandwidth of another data stream.

The next day, I think while walking to the grocery store, it occurred to me that I could do the same thing with a mapping trick and some modular arithmetic.

I was prematurely pleased with myself. That version took two lines of code.

Posted by Milligan at December 7, 2007 11:27 AM | TrackBack
Comments
Post a comment









Remember personal info?






The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.