Hash Tables Flashcards

1
Q

A data structure where key is also the index.

A

Direct-Address-Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Direct addressing works well if the universe U of keys is _________.

A

small

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

________ reduce the storage requirement to O |K| while maintaining O 1 average-case time.

A

Hash tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

We use a ___________ to compute the position from the key k.

A

hash function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An ideal theoretical abstraction that says each key is equally likely to hash to any
of the m positions, independently of
where any other keys have hashed to.

A

independent uniform hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

independent uniform hash function aka _______________

A

a random oracle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A good hash function ___________________ an
independent uniform hash function.

A

approximates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Uses a single, fixed hash function for any data.

A

Static hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If the hash function is known, keys can be maliciously hashed to the same position.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The hash function is picked at random
from a family of hashing functions.

A

Random hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Collision Resolutions

A

Chaining (Open Hashing)
Probing (Closed Hashing)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Each nonempty hash-table slot T[j]
points to a linked list of all the keys whose hash value is j.

A

Chaining aka Open Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When inserting a new element,
- if its “first-choice” location is free,
insert the element
- else if its “second-choice” location is
free, insert the element
- and so on, until a free spot is found

aka _________________

A

Probing, Open Addressing aka Closed Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If the first choice position is occupied, probe the next position

A

Linear Probing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

__________ prevents the formation of blocks in linear probing

A

quadratic probing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

We use a second hash function to
probe.

A

Double hashing

16
Q

When deleting an element, either move entries backwards, or mark entries as deleted (flag) also known as ____________

A

Lazy Deletion