CS301 Lec41
CS301 Lec41
S3
S2 34
S1 23 34
S0 12 23 34 45
Lecture No.41
Data Structure
20 26 30 40 50 57 60
A quad-node stores:
• item
quad-node
• link to the node before
• link to the node after
• link to the node below
• link to the node above
x
This will require copying the
key (item) at different levels
Skip Lists with Quad Nodes
S3
S2 31
S1 23 31 34 64
S0 12 23 26 31 34 44 56 64 78
Performance of Skip Lists
and so on
Anything better?
An array in which
TableNodes are not stored key entry
consecutively
Their place of storage is
4
calculated using the key and
a hash function
10
hash array
Key index
function
123
Keys and entries are
scattered throughout the
array.
Hashing
length 1
h( str ) str[i ] b %T
i
i 0
0
Example : h( ABC ) (65b 66b 67b )%T
1
2
Example Hash Functions