Thursday, September 25, 2008

What I Accomplished Today in Computer Science Class


Some people might think that I was knitting a sock.

However, I was really working with an abstracted version of a data structure. Each stitch points to the next stitch, and the working yarn points to the element that you've just accessed. k2tog removes an item from the list, and m1 adds an element to the list. (Flat knitting is a stack. If you allow random access to your data structure, then you can knit cables.)

I think that this weekend I'm going to knit versions of some classic sorting algorithms.