Question

You are given a hash table which uses separate chaining. The
table has a size of 10.

The hash function being used is h(x) = x.

You insert 6, 13, and 201 into the hash table. If you then insert(3) into the hash table, it will be put at which index?

You insert 9, 19, and 29 into the hash table. What is the size of the bucket at index 9?

Answer #1

**Ans).**

Hash function is h(x)= x and table size is 10.

when we insert 6, it'll ho at 6%10 = 6 index.

13 goes at 13%10=3 index

201 goes at 201%10=1 index.

Now when we insert 3, it'll go to 3%10=3 index.

Since 13 is already there, and are using chaining technique, we'll append 3 at the linked list at index 3.

so now, index 3 consists of a list containing 13 and 3.

when we put 9,19 and 29, all of them have same hash value and thus index which is 9. So all three will go to the bucket/list at index 9.

Therefore at index 9, bucket size is three.

**Hope it helped! Feel free to ask any doubt in comments.
Don't forget to upvote if it helped :).**

Q2.1 Chaining
Insert 17,44,74,88 , in order, into an
empty hash table of size 5 with chaining, using hash function
h(x)=x mod 5
Write/draw the resulting table
Q2.2 Open addressing with linear probing
Insert the same numbers in the same order into an
open-addressing initially empty table using linear probing, with
the same hash function h(x)=x mod 5. Draw/write down the resulting
table

Assume that n items are mapped to a hash table of size m
(separate chaining) by simple uniform hashing. a. What is the
probability that a given row of the hash table has at least 2
items? b. What is the probability that some row of the hash table
has at least 2 items?

1) Suppose that you have table size M=101 and you are using
double hashing. The first hash function h1, is used to determine
the home position, and the second hash , h2, is used to determine
the increment for linear probing. Suppose you have two records with
keys k1, and k2, such that: h1(k1) = 5, h2(k1)= 3, h1(k2) = 5,
h2(k2) = 11. Note: h2 is returning an offset, not an index.
Fill in the Blank :
The First...

Suppose you are building a hash table and want the probability
of collision in your has function to be less than 10-6.
The output of your hash function is a sequence of bits (e.g.,
1001010111 is a sequence of 10 bits). What is the minimum number of
bits needed for the hash function output to achieve the desired
probability of collision.
You may use the approximation 103 = 210 to
simplify your math if you wish.

You have been given the expected return data shown in the first
table on three assets—F, G, and H—over the period 2015-2018
Year
Asset F
Asset G
Asset H
2015
9
12
15
2016
8
9
16
2017
5
21
19
2018
13
6
11
a. Find the
expected return, variance, std dev and coefficient of variation for
each asset.
b. Now consider a portfolio that consists of 25% of F,
50% of G and 25% of H. Find the expected...

You have been given the expected return data shown in the first
table on three assets—F, G, and H—over the period 2016-2019
Year
Asset F
Asset G
Asset H
2016
7
10
15
2017
6
8
16
2018
3
19
19
2019
11
9
11
Using these assets, you have isolated the three investment
alternatives shown in the following table.
Alternative
Investment
1
100% of asset F
2
75% of asset F and 25% of asset G
3
50% of...

Consider total cost and total revenue given in the following
table:
Quantity 0 1 2 3 4 5 6 7
Total cost $8 9 10 11 13 19 27 37
Total revenue $0 8 16 24 32 40 48 56
a. Calculate profit for each quantity. How much should the firm
produce to maximize profit?
b. Calculate marginal revenue and marginal cost for each quantity.
Graph them. (Hint: Put the points between whole numbers. For
example, the marginal cost between...

Plant sizes get larger as you move from ATC-1 to ATC-4. Output
ATC-1 ATC-2 ATC-3 ATC-4 1,500 $10 15 $20 $30 2,000 8 12 17 25 2,500
9 10 15 20 3,000 12 8 13 18 3,500 15 6 11 16 4,000 18 10 9 14 4,500
20 12 7 12 5,000 24 15 11 10 5,500 29 19 13 8 6,000 35 25 15 9
Which plant size would produce at the least cost for the
1,500-2,500 range of...

How to find mean squared error from given information?
The data in the table were collected from n = 10 home sales.
Property appraisers used the data to estimate the population
regression model of
E(Sales Price) = b0 +
b1(Home Size),
where
Sales Price (in thousands of dollars)
Home Size (in hundreds of square feet)
Sales Price
Home Size
160
23
132.7
11
157.7
20
145.5
17
147
15
155.3
21
164.5
24
142.6
13
154.5
19
157.5
25
The...

You are given a solution that is 0.032 in Cu2+ and
0.032 in Ca2+ that you wish to separate using selective
ion precipitation with OH- ions. The Ksp value for
Cu(OH)2 = 4.80 X 10-20 and the Ksp value for
Ca(OH)2 = 5.02 X 10-6. The two metal
hydroxides used to set the pH threshold for the separation is
Ca(OH)2
b) What is the threshold pH, below which you get precipitation of
the least soluble metal hydroxide while the most...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 33 seconds ago

asked 3 minutes ago

asked 3 minutes ago

asked 7 minutes ago

asked 25 minutes ago

asked 42 minutes ago

asked 45 minutes ago

asked 45 minutes ago

asked 47 minutes ago

asked 47 minutes ago

asked 1 hour ago

asked 1 hour ago