In: Computer Science
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 |