week 1 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

hash function takes as argument§

A

hash key

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

hash function has as output

A

bucket number

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

task hash key

A

send approx equal amount of hask keys to each of B buckets (uniformly distributed into buckets)

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

not good wehn B has…

A

common factor with most hash keys, non random distribution

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

choose b to be

A

prime

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

if hash key string

A

hash(sum(ascii_code(character in string field))) and do procedure as previously

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

index

A

data structure that makes it efficient to retrieve objects, given the value of >=1 elements of those objects

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

objects

A

= records

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

index is build on..

A

one of fields of record. given v of that field -> retrieves all records having value v in field

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

index implementation=

A

hash table

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

hash table

A

hash keys: field/fields on which indexing is done
records placed in buckets determined by hash function
given hash key -> hash it -> find bucket -> search in bucket for records with that value of hash key

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

disk is organized in

A

blocks

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

main memory is organized in

A

words

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

want to do computations in

A

main memory

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

blocks:

A

minimum uunits that OS moves to/from main memory

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

how much slower is it to read a disk block

A

it takes 10 ms, at least 5 order of magnitutes (factor of 10^5) slower than time taken to read a word (32 bits, block 64kbytes)

17
Q

Define a hash-function for an index containing objects records with two fields, one of type string, and one of type integer.

A

hash(record(string_field, integer_field) = hash(string_field) + hash(integer_field)
hash(string_field) = hash(sum(ascii_code(character in string field)))
For both hashing the string field and hashing the integer field the following hash function is used: hash(integer) = integer mod B, where B is prime (this last condition is necessary as we do not know the range of the hash-keys).

18
Q

What is a regular expression? Give examples of at least three regular expression operators.

A

A regular expression is a special string used to define string patterns. It uses characters and operators as “|”, “*”, “+”, etc., to denote disjunction, repetition, repetition at least one time, etc.