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
import random | |
import math | |
from hashlib import md5 | |
class MyHashTable(object): | |
def __init__(self, hash_functions, len_table): | |
self.hash_functions = hash_functions | |
self.len_table = len_table | |
self.table = [-1]*self.len_table |
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
#!/usr/bin/python3 | |
# author: @ijkilchenko | |
# MIT License | |
import math | |
import hashlib | |
import random | |
from collections import defaultdict | |
def base10_to_baseB(num, B): |
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
# author: @ijkilchenko | |
# MIT License | |
def words_over_vocab(vocab, n): | |
return _words_over_vocab(vocab, '', n) | |
def _words_over_vocab(vocab, word, n): | |
if len(word) == n: | |
yield word | |
else: |
NewerOlder