PEP8 formatting.
This commit is contained in:
@@ -6,6 +6,7 @@ don't attempt parfect hashing, but simply generate an open addressed
|
||||
quadratically probed hash table.
|
||||
"""
|
||||
|
||||
|
||||
def simple_hash(s):
|
||||
"""
|
||||
Compute a primitive hash of a string.
|
||||
@@ -21,6 +22,7 @@ def simple_hash(s):
|
||||
h = ((h ^ ord(c)) + ((h >> 6) + (h << 26))) & 0xffffffff
|
||||
return h
|
||||
|
||||
|
||||
def next_power_of_two(x):
|
||||
"""
|
||||
Compute the next power of two that is greater than `x`:
|
||||
@@ -41,6 +43,7 @@ def next_power_of_two(x):
|
||||
s *= 2
|
||||
return x + 1
|
||||
|
||||
|
||||
def compute_quadratic(items, hash_function):
|
||||
"""
|
||||
Compute an open addressed, quadratically probed hash table containing
|
||||
|
||||
Reference in New Issue
Block a user