I hereby claim:
- I am KatrinaE on github.
- I am katrinaeg (https://keybase.io/katrinaeg) on keybase.
- I have a public key whose fingerprint is 9708 60C6 AFE5 7F76 251B 1355 8051 A029 BB92 B537
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
INIT_SIZE = 10 | |
MAX_AVG_COLLISIONS = 1 | |
FREQ_OF_COLLISIONS_CHECK = 0.67 | |
class HashTable(object): | |
def __init__(self): | |
self.arr = self._create_array(INIT_SIZE) | |
self.insert_counter = 0 | |
def _create_array(self, size): |
def queens(n): | |
queens_helper([], 1, n) | |
def queens_helper(occupied, col_to_test, n): | |
if len(occupied) == n: | |
print occupied | |
else: | |
# attempt to place queen | |
if is_free(col_to_test, occupied): |
#!/usr/bin/env python | |
import random | |
def queens(n): | |
"""Places n queens on an n*n chessboard so that each is safe from all others. | |
This solution uses a depth-first backtracking algorithm. | |
Argument | |
======== |