4
Write the shortest code that traverses a tree, depth-first.
Input
Any programmatical structure found in your language of choice: lists, tuples, queues etc.
Output
A list of "names" of the nodes in correct order as shown in Depth-first search article at Wikipedia.
Requirement: A node should be able to contain the infinite number of child nodes. – Yasir Arsanukaev – 2011-02-06T13:40:28.370
Also, you're not required to actually print the result, just returning the correct result with the ability to use it in your program will do; I didn't really print mine below, the function simply returned a list.
– Yasir Arsanukaev – 2011-02-06T15:01:26.037