
306 ◾ Computational Thinking for the Modern Problem Solver
Some algorithms have execution times that grow much faster than
polynomial algorithms. As an example consider the operation of a com-
bination padlock such as that pictured in Figure10.11. Now suppose that
you have forgotten your combination to such a padlock.
One algorithm for recovering the forgotten combination is to attempt
all possible combinations until the correct one is discovered. What we
know about padlocks of this type is that a combination generally consists
of rotating the dial clockwise to one integer marking, then counterclock-
wise past and to a second integer ma ...