aboutsummaryrefslogtreecommitdiffstats
path: root/OLD/csci4041/hw3prob2.py
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-05-24 11:18:46 -0500
committerMatt Strapp <matt@mattstrapp.net>2022-05-24 11:19:55 -0500
commit7a73162607544204032aa66cce755daf21edebda (patch)
tree58578e01f15f34a855d99c32898db9d7a1603e67 /OLD/csci4041/hw3prob2.py
parentdo some stuff (diff)
downloadhomework-7a73162607544204032aa66cce755daf21edebda.tar
homework-7a73162607544204032aa66cce755daf21edebda.tar.gz
homework-7a73162607544204032aa66cce755daf21edebda.tar.bz2
homework-7a73162607544204032aa66cce755daf21edebda.tar.lz
homework-7a73162607544204032aa66cce755daf21edebda.tar.xz
homework-7a73162607544204032aa66cce755daf21edebda.tar.zst
homework-7a73162607544204032aa66cce755daf21edebda.zip
Graduate
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'OLD/csci4041/hw3prob2.py')
-rw-r--r--OLD/csci4041/hw3prob2.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/OLD/csci4041/hw3prob2.py b/OLD/csci4041/hw3prob2.py
deleted file mode 100644
index 33f36f6..0000000
--- a/OLD/csci4041/hw3prob2.py
+++ /dev/null
@@ -1,21 +0,0 @@
-def ADDYHASHSEARCH(T,k):
- i=0
- j=0
- s=1
- m=len(T)
- while T[j]!=None and i<=m:
- j=(h(k)+i)%m
- if T[j] is k:
- return j
- else:
- i=i+s
- s=s+2
- return -1
-
-def h(k):
- return k*2
-
-T = [0,None,1,None,2,None,3,None,4]
-print(ADDYHASHSEARCH(T,1))
-print(ADDYHASHSEARCH(T,3))
-print(ADDYHASHSEARCH(T,5)) \ No newline at end of file