Pruning the tree works one-derfully here, because the answer is such a small number.
If the answer was, say, a two digit number, then much more of the tree would have been to be visited. My program runs for milliseconds (if the bound is set to 20 or 40) and for microseconds (if the bound is set to 2).
|