HashTable CISC4080, Computer Algorithms CIS, Fordham Univ.
- Instructor: X. Zhang
HashTable CISC4080, Computer Algorithms CIS, Fordham Univ. - - PowerPoint PPT Presentation
HashTable CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang Spring 2018 Acknowledgement The set of slides have used materials from the following resources Slides for textbook by Dr. Y. Chen from Shanghai
2
3
NULL
4
T
Insert ( element(2,Alice)) T[2]=element(2, Alice); Delete (element(4)) T[4]=NULL; Search (element(5)) return T[5];
2, Alice 1 2 4, Bob 5, Ed …. NULL U: the set of all possible key values K: actual set of keys in your data
5 U: the set of all possible key values K: actual set of keys in your data
6
Collision: when two different keys are mapped to same index.
avoided? Is it possible to design a hash function that is one-to-one? Hint: domain and condomain of hash()?
7
So that we don’t waste memory space
8
9
10
11
12
13
14 X
16
17 Here doubly-linked list is used
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40