Relating to the contest analysis for Decision Tree: > The hard part here was parsing the tree. The easiest way to do this is by > using a technique called recursive descent.
In (especially, but certainly not limited to) dynamic languages, there's an even easier technique, which is to use regular expressions to transform the S-expressions into JSON expressions, then slurp it in using any JSON library. Of course, if you're using a Lisp-based language, then parsing is as simple as (read). I'm mentioning this because the analysis for Alien Language noted a trivial transformation of the input into regular expressions; I thought that the transformation described above would also be trivial and worth mentioning in the analysis. :-D As an aside, some of us on the #gcj channel are participating in a "1B- A code golf" (where 1B-A refers to the Decision Tree problem): http://1b-a.pastebin.com/ :-P Cheers, Chris. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-code@googlegroups.com To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-code?hl=en -~----------~----~----~----~------~----~------~--~---