[SOLVED] CE3345 Assignment5-Solved
34.99 $
Programming resource
✓
Practical programming resource
✓
Suitable for guided study and reference
✓
Tutor guidance available when needed
Description
- [20 Points] Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x mod 10, show the resulting:
- Separate Chaining hash table
- Hash Table using linear probing
- Hash table using quadratic probing
- Hash table with second hash function h2(x) = 7 – ( x mod 7)
- [10 Points] A min-max heap is a data Structure that supports both deleteMin and deleteMax in O(logN) per operation. The structure is identical to a binary heap, but the heap-order property is that for any node, X, at even depth, the element stored at X is smaller than the parent but larger than the grandparent ( where this makes sense), and for any node X at odd depth, the element stored at X is larger than the parent but smaller than grandparent. See Fig.
- How do we find the minimum and maximum element?
- Give an algorithm to insert a new node into the min-max heap.
- [10 Points] Merge the two binomial queues
- [10 Points] Give an algorithm to find all nodes less than some value X, in a binary heap. Your algorithm should run in O(K), where K is number of nodes output.
Resource details
Understand the Task Before You Use the Resource
Review the requirements, identify the programming concepts
involved, study the implementation and test your understanding
with your own examples and modifications.