Question

1. Suppose that a hash table contains hash_size = 13 entries indexed from 0 through 12...

1. Suppose that a hash table contains hash_size = 13 entries indexed from 0 through 12 and that the following keys are to be mapped into the table:

24    34    33    55    46    38    37

The hash function determines the hash address by first summing all digits of a key (in ordinary decimal representation) and then applying % hash_size.    Answer the following questions.

Assume that double hashing g(k) = 7 – (k mod 7) is used. Present the hash table after all keys are inserted in the given order.

0

1

2

3

4

5

6

7

8

9

10

11

12

24

34

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1. Suppose that a hash table contains hash_size = 13 entries indexed from 0 through 12...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider a hash function hashing a key K to a table of n buckets (indexed from...

    Consider a hash function hashing a key K to a table of n buckets (indexed from 0 to n - 1). Which of these would be acceptable hash functions -- meaning that they would work correctly for both insertions and searches? Assume the function Random(n) returns an integer between 0 and n - 1, inclusive. (Select all that apply). Group of answer choices 1. h(K) = k mod n 2. h(K) = Random(n) 3. h(K) = n 4. h(K) =...

  • Assume a Hash table has 7 slots and the hash function h(k) = k mod 7...

    Assume a Hash table has 7 slots and the hash function h(k) = k mod 7 is used. The keys 14, 3, 11, 6, 10, 4, 20, and 17 are inserted in the table with collision resolution by chaining. Assume that the keys arrive in the order shown. (a) Show the hash table obtained after inserting all 8 keys. [Show only the final table] (b) Under the assumption that each key is searched with probability 1/8, calculate expected number of...

  • 1. Using closed hashing with double hashing to resolve collisions insert the following keys into a...

    1. Using closed hashing with double hashing to resolve collisions insert the following keys into a table with 11 slots, numbered 0 through 10. The hash functions to be used are H1(k)k(mod11) and H2(k)- Rev(k + 1) (mod11) The function REV reverses the decimal digits like Rev(376) 673. Show the hash table after all nine keys have been inserted. Be sure to indicate how H1 and H2 are used. Keys: 4, 3, 2, 8, 33, 17, 24, 35, 46

  • 5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and...

    5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and the hash function h(x) = x mod 5. i. (1) Pick 8 random numbers in the range of 10 to 99 and write the numbers in the picked sequence. Marks will only be given for proper random numbers (e.g., 11, 12, 13, 14 ... or 10, 20, 30, 40, .. are not acceptable random sequences). ii. (2) Draw a sketch of the hash table...

  • I need help for Q11 Please if you can, answer this question too. I need B...

    I need help for Q11 Please if you can, answer this question too. I need B Q11. A complete graph is a graph where all vertices are connected to all other vertices. A Hamiltonian path is a simple path that contains all vertices in the graph. Show that any complete graph with 3 or more vertices has a Hamiltonian path. How many Hamiltonian paths does a complete graph with n vertices has? Justify your answer Q1. Draw thee 13-entry hash...

  • Please Answer as soon as possible. Thank you so much. 5. Below is an array with...

    Please Answer as soon as possible. Thank you so much. 5. Below is an array with 15 positions, which is used as a hash table to keep some IDs. The key to each record is the 3-digit customer's ID. The hash function h gives the index of the slot in the array for the key k: h(k)=%15. The method of collision resolution is double hashing. Hence, if collision happens, we repeatedly compute (h(key) + iha(key)) mod 15, for i from...

  • Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60,...

    Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers keys in post-order - Retrieve the integers keys in pre-order - Draw a binary search tree after node 58 is deleted b) Create a Hash Table using the methods described below. Show the final array after all integer keys are inserted. Assumes that...

  • 1. Given the following physical addresses and value in memory: add 0 val 9 10 11 12 13 1415161181...

    1. Given the following physical addresses and value in memory: add 0 val 9 10 11 12 13 14151611819 2021 22 23 18 24 20 32 0 40 8 32 245458 10 36 34 3230 40 35 3028 add 24 25 26 27 28 29 30 31 32 33 34 | 35 | 36 37 38 39 40 | 41 | 42 | 43 44 45 46 47 8 40 35 1614 12 12 22 24417 21 23 25 27...

  • Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers ke...

    Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers keys in post-order - Retrieve the integers keys in pre-order - Draw a binary search tree after node 58 is deleted b) Create a Hash Table using the methods described below. Show the final array after all integer keys are inserted. Assumes that...

  • SU 2020 Example Using Chaining 0 1 A hash table which is initially empty. Every element...

    SU 2020 Example Using Chaining 0 1 A hash table which is initially empty. Every element is a LinkedList object. Only the start pointer of the LinkedList object is shown, which is set to NULL 2 3 4 5 The hash function is: 6 h(k)=k%7 CS 2121 Deliverables • Insert Following Numbers in order of 31, 9, 36, 42, 46, 20, 2, 24 After Insertion, how how you find Number 9 and 2 Scan your completed work as FirstLastHw07.pdf to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT