This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a recursive function that produces big numbers. What is the time complexity of this? | |
def big(a, b, depth): | |
if depth == 0: | |
return a*b # assume this takes one unit of time | |
out = 1 | |
for i in xrange(b): # repeat the following b times | |
out = big(a, out, depth-1) | |
return out |