aboutsummaryrefslogtreecommitdiffstats
path: root/csci4041/hw3prob2.py
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2020-05-09 14:09:47 -0500
committerRossTheRoss <mstrapp@protonmail.com>2020-05-09 14:09:47 -0500
commit9deabe475c28a7547522be62bc263143db9bf721 (patch)
tree105e0dc321dd3b942ed7957b74368a740e9dbea5 /csci4041/hw3prob2.py
parentoops (diff)
downloadhomework-9deabe475c28a7547522be62bc263143db9bf721.tar
homework-9deabe475c28a7547522be62bc263143db9bf721.tar.gz
homework-9deabe475c28a7547522be62bc263143db9bf721.tar.bz2
homework-9deabe475c28a7547522be62bc263143db9bf721.tar.lz
homework-9deabe475c28a7547522be62bc263143db9bf721.tar.xz
homework-9deabe475c28a7547522be62bc263143db9bf721.tar.zst
homework-9deabe475c28a7547522be62bc263143db9bf721.zip
rearrange homework folders
Diffstat (limited to 'csci4041/hw3prob2.py')
-rw-r--r--csci4041/hw3prob2.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/csci4041/hw3prob2.py b/csci4041/hw3prob2.py
deleted file mode 100644
index 33f36f6..0000000
--- a/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