Created
March 9, 2014 20:41
-
-
Save maxskorr/9454239 to your computer and use it in GitHub Desktop.
backtrack
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
MAX = 5 | |
l = dict(zip(range(0, MAX), [False for i in xrange(0, MAX)])) | |
def backtrack(): | |
for k in xrange(0, MAX): | |
if not l[k]: | |
l[k] = True | |
print k, | |
backtrack() | |
l[k] = False | |
print '' | |
backtrack() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment