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.
no subject
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.