Question

In: Computer Science

1.) Consider inserting values 15, 22 and 29 in the order given into a hash table...

1.) Consider inserting values 15, 22 and 29 in the order given into a hash table of size 7 with hash function h(x) = x mod 7. What will be the locations be the respective locations for 15, 22 and 29 in the hash table if quadratic probing is used to resolve colisions?

a.

1, 2, 4

b.

1, 2, 3

c.

1, 2, 0

d.

1, 1, 1

2.) Consider the following sequences of addqs and removeqs, what order will the items be removed from the queue?

addq(2), addq(3), removeq(), removeq(), addq(7), addq(8), removeq()

a.

8 7 3 2

b.

3 2 7 8

c.

2 3 7 8

d.

None of the above

3.) Consider the following values: 20, 10, 45, 23, 46, 75, 15. What value will be at the root of the tree created by inserting these values in the order given to build a max heap?

a.

10

b.

75

c.

23

d.

20

Solutions

Expert Solution


Related Solutions

Consider inserting values 15, 22 and 29 in the order given intoa hash table of...
Consider inserting values 15, 22 and 29 in the order given into a hash table of size 7 with hash function h(x) = x mod 7. What will be the locations be the respective locations for 15, 22 and 29 in the hash table if quadratic probing is used to resolve colisions?a.1, 2, 4b.1, 2, 3c.1, 2, 0d.1, 1, 1
Consider inserting n distinct keys into a hash table with m buckets, where collisions are resolved...
Consider inserting n distinct keys into a hash table with m buckets, where collisions are resolved by chaining and simple uniform hashing applies. 1. What is the probability that none of the n keys hashed to a particular bucket? 2. What is the expected number of empty buckets? 3. What is the expected number of collisions?
Consider a sample with data values of 26, 25, 22, 17, 32, 33, 29, and 25....
Consider a sample with data values of 26, 25, 22, 17, 32, 33, 29, and 25. Compute the range, interquartile range, variance, and standard deviation (Round to 2 decimals, if necessary). Range Interquartile range Variance Standard deviation
Consider a sample with data values of 26, 25, 22, 16, 32, 33, 29, and 25....
Consider a sample with data values of 26, 25, 22, 16, 32, 33, 29, and 25. Compute the 20th, 25th, 65th, and 75th percentiles (to 1 decimal, if decimals are necessary).
Consider a sample with data values of 27, 24, 22, 16, 30, 35, 29, and 24....
Consider a sample with data values of 27, 24, 22, 16, 30, 35, 29, and 24. Compute the 20th, 25th, 65th, and 75th percentiles (to 1 decimal, if decimals are necessary).
Consider a sample with data values of 26, 25, 20, 15, 31, 33, 29, and 25....
Consider a sample with data values of 26, 25, 20, 15, 31, 33, 29, and 25. Compute the 20th, 25th, 65th, and 75th percentiles. 20th percentile 25th percentile 65th percentile 75th percentile
Draw each binary tree that is the maximum heap that results from inserting one by one in the order given the values 20, 15, 25, 30, 45, 18, 10, 12, 16.
In Java-Draw each binary tree that is the maximum heap that results from inserting one by one in the order given the values 20, 15, 25, 30, 45, 18, 10, 12, 16. Note that your tree diagram should show the heap after the maximum heap property has been restored. Submit nine diagrams.Next, draw each binary tree that is the maximum heap as each maximum value is deleted from the above tree and after the maximum heap property has been restored....
Consider a sample with data values of 27, 24, 22, 15, 31, 33, 28, and 24....
Consider a sample with data values of 27, 24, 22, 15, 31, 33, 28, and 24. Compute the range, interquartile range, variance, and standard deviation (Round to 2 decimals, if necessary).
Consider this table of values for a function: x f(x) -3 15 -2 2 -1 -5...
Consider this table of values for a function: x f(x) -3 15 -2 2 -1 -5 0 -3 1 4 2 8 3 -12 How many zeroes does this function appear to have? Where are those zeroes (give intervals of x-values). Use interval notation. Can you be guaranteed that those are the only zeroes? Why or why not? If I told you that the table represented a third degree (cubic) polynomial, is that enough to guarantee that those are the...
1.Consider hashing with a table size of 100 and a hash function of key%tablesize. Insert 25...
1.Consider hashing with a table size of 100 and a hash function of key%tablesize. Insert 25 keys. Do you expect to see any collisions? Why or why not? Yes, because random values likely will land on same locations. No becase there are four times as many slots as needed. 2. Secondary clustering means that elements that hash to the same position will probe to the same alternate cells. Simple hashing uses key%tablesize as the hash function. Which of the following...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT