I need the answer to be written in a clear hand writing . ----------------------
ID: 3588013 • Letter: I
Question
I need the answer to be written in a clear hand writing .
------------------------------------------------------------------------------------------------------------------------------
(12 points) Insert the following keys, in order, into a hash table for each case below. 17, 23, 40, 12, 6, 28 1. The hash function: H(key)- key mod tableSize Case a. Open addressing with linear probing. Case b. Open addressing with quadratic probing. Case c. Open addressing with double hashing, where the hash function for probing is: P(key)-c-key mod c), where c = 7. Case d. Separate chaining. Case d: Case c. index valueindex valueindex value Case b. Case a. index value 0 1 0 1 0 0 4 4 4 7 5) 10 10 1 10Explanation / Answer
Linear probing :
Case b : Quadratic probing :
Case c : double hashing :
case d :
chaining :
----------------------------------------------------------------------------------------------
2) c) heap is a binary tree.
Heap can be complete or almost complete tree.
But heap is always a binary tree.
Hence c is correct answer.
3)
a) in max heap largest item can be removed in O(log n) time
and insterted in O(log n) time.
b) In min Heap smallest item is always at root.
c) This is a default property of Heap hence it is true.
d) Heap doesnt support ordered traversal, as all elements are not sorted in heap.
4)
True
Element is always added to the end of heap and then heap is being heapified.
if you have any doubts then you can ask in comment section.
case a : 0 1 23 2 12 3 4 5 6 17 7 40 8 6 9 28 10