Skip to content

Instantly share code, notes, and snippets.

View ijkilchenko's full-sized avatar
👽

Alex Ilchenko ijkilchenko

👽
View GitHub Profile
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
#!/usr/bin/python3
# author: @ijkilchenko
# MIT License
import math
import hashlib
import random
from collections import defaultdict
def base10_to_baseB(num, B):
# 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: