22. Given a sequence of keys (57, 20, 7, 78, 33, 15, 36, 9, 16), a hash table HT
ID: 3909218 • Letter: 2
Question
22. Given a sequence of keys (57, 20, 7, 78, 33, 15, 36, 9, 16), a hash table HTTO.12], and the hashing function HOkey) - key % 13. If we use linear probing to solve possible collisions, then element 33 should be put in position 12 3 4 5 67 89 10 11 12 78 57 20 7 23. Given an AOE (activity on edge) graph in Fig. 4, the critical path (a sequence of vertices) is Fig. 4 An AOE graph 24. Given a simple graph in Fig. 5, please write its adjacency matrix A simple graph 25. Given a weighted graph in Fig. 6, please write the shortest path from vertex v, to v Fig, 6 A weighted directed graph. 3 of 4Explanation / Answer
22. hash function is H(key) = key%13
the hash table has the location from 0 to 12.
to store 33 we will find H(33) = 33%13 = 7
33 will be stored at the 7th location. But it is already filled by 20.
To remove collision we are using linear probing i ,i+1,i+2,i+3,................................
so 7+1 =8 , but the 8th location is filled by 7.
7+2 =9, it is empty so 33 will be stored at location number 9.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.