ext_283717 ([identity profile] eyelessgame.livejournal.com) wrote in [personal profile] dtm 2004-03-03 09:23 am (UTC)

cool solution -- one that many people would miss because they'd reflexively chomp after reading each line.

By the way, in your C snippet, it's

typedef listNode *list;

not the other way around.

The linked list example is a fun problem. The lesson is that many special cases can be resolved with an extra layer of indirection -- one could argue that a lot of object-oriented programming relies on exactly this statement.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting