Created
October 15, 2015 03:17
-
-
Save stevester94/75a59fb3d2b307f5353a to your computer and use it in GitHub Desktop.
snippet for recursive matrix running times
This file contains hidden or 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
| def recTest(n, constant, divisibleBy): | |
| if n <= divisibleBy: | |
| return constant | |
| else: | |
| total = recTest(n/4, constant, divisibleBy) | |
| total = total + recTest(n/4, constant, divisibleBy) | |
| total = total + recTest(n/4, constant, divisibleBy) | |
| total = total + recTest(n/4, constant, divisibleBy) | |
| return total | |
| for n in range(0,100): | |
| numIn = pow(68,n) | |
| print str(n) + "," + str(recTest(numIn, 132464, 68)) + "," + str(recTest(numIn, 143640, 70)) + "," + str(recTest(numIn, 155424, 72)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment