in reply to Golf: Tree searching
61 chars. Passes -w and use strict.sub f{my($s,$t)=@_;$t?$$t{d}eq$s?$t:f($s,$$t{l})||f($s,$$t{r}):0}
Hint: You don't have to take advantage of the binary search property...
|
---|
In Section
Meditations
in reply to Golf: Tree searching
61 chars. Passes -w and use strict.sub f{my($s,$t)=@_;$t?$$t{d}eq$s?$t:f($s,$$t{l})||f($s,$$t{r}):0}
|
---|