Skip to content

Instantly share code, notes, and snippets.

@Rahajustone
Created March 17, 2014 17:48
Show Gist options
  • Save Rahajustone/9604532 to your computer and use it in GitHub Desktop.
Save Rahajustone/9604532 to your computer and use it in GitHub Desktop.
#dosya çağirdik
dosyaismi = open("./algoritmalar_2014_ogrenci_listesi.csv","r")
isimler=dosyaismi.read().split("\n")
def BKDRHash(key):#1.09
seed = 131 # 31 131 1313 13131 131313 etc..
hash = 0
for i in range(len(key)):
hash = (hash * seed) + ord(key[i])
return (hash % 150)
slotlist=[] #boş liste oluşturduk
for isim in isimler:
print(isim," slotu -->",BKDRHash(isim))
slotlist.append(BKDRHash(isim))
print("raha",slotlist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment