Question

10. (5 points) Consider data with integer keys 28, 21, 11, 47, 36, 19, 32 in that order inserted into a hash table of size 7
0 0
Add a comment Improve this question Transcribed image text
Answer #1

. Answer ; Insent 28 hlkey)= k % 7 = 1877 = 0 So 28 will stone in o index. 28 Insent qui h(21) = 21%7= 0 . . So ai will store

Inseant 47:- ..h(4-7) – 47%9 = 5 So 47 will stone in oth index oli 12 | 3 | 4 11 g | 47 | In seat 36: 6(36) = 367. 7 = 1 →S0Inseat 39: h(32) = 32%7=4 → So 4th index already have a element. So it will chain to 3d. Because it is chaining hash table Lo

Note: my friend if you have any questions or queries just simply comment below. Thank you.

Add a comment
Know the answer?
Add Answer to:
10. (5 points) Consider data with integer keys 28, 21, 11, 47, 36, 19, 32 in...
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
  • 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...

  • 1) Using Java. Insert the key sequence [29, 33, 1, 37, 32, 26, 48, 11 ,...

    1) Using Java. Insert the key sequence [29, 33, 1, 37, 32, 26, 48, 11 , 40, 17, 36, 12, 41, 25, 30, 23, 28, 39, 6, 43] with hashing by chaining in a hash table with size 17. Use the hash function: h(k) = k mod 17. a) Show the final table. b) Indicate at which insertion the first collision occurred. c) Indicate which index that has the longest chain.

  • [Heap] Create a min-binary heap using following numbers (appearing/inserting in the given order): 5, 22, 19,...

    [Heap] Create a min-binary heap using following numbers (appearing/inserting in the given order): 5, 22, 19, 56, 50, 25, 1, 3, 10, 6, 32, 12, 11                [Hint: you can put the items in sequence in a binary tree and then use the buildHeap() method.] [Hashing] Consider a hash table where the hash function h is defined as the modulo 10 operation i.e., for any integer k, h(k) = k % 10 (the ‘modulo 10’ operator returns the remainder when k...

  • Let 'M' denote the hash table size. Consider the following four different hash table implementations: a....

    Let 'M' denote the hash table size. Consider the following four different hash table implementations: a. Implementation (I) uses chaining, and the hash function is hash(x)x mod M. Assume that this implementation maintains a sorted list of the elements (from biggest to smallest) for each chain. b. Implementation (II) uses open addressing by Linear probing, and the hash function is ht(x) - (hash(x) + f(i)) mod M, where hash(x)x mod M, and f(i)- c. Implementation (III) uses open addressing by...

  • 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...

  • 11. (10 Points) Draw the final result after inserting keys 24, 25, 50, 38, 12, 90...

    11. (10 Points) Draw the final result after inserting keys 24, 25, 50, 38, 12, 90 into a hash table with collisions resolved by (a) linear probing, (b) chaining. Let the table have 13 slots with addresses starting at 0, and let the hash function be h(k) k mod 13 (a) (5 Points) Linear Probing 0 1 2 3 4 5 6 789 10 11 12 [ANSWER] (b) (5 Points) Separate Chaining ANSWER]

  • Explain each answer. Select the correct option for the following multiple choice questions or provide short...

    Explain each answer. Select the correct option for the following multiple choice questions or provide short answers accordingly: 1. Consider a hash table with chaining, of size N. Assume in each of the following scenarios the table starts empty. Further assume K pairs of <key, element> are added and K N Then, in which of the following situations will a find operation for a particular key have a potential worst-case runtime of O(N) a) The keys of all elements are...

  • In C++ raw the hash table that results from separate chaining using the follo 15 4...

    In C++ raw the hash table that results from separate chaining using the follo 15 4 22 7 18 21 8 35 11 28 and the following hash function h(key)-key % 7 with a hash table size of 7. [47.1 points

  • DATA STRUCTURE: Draw the structure that results from inserting the following numerical keys into each of...

    DATA STRUCTURE: Draw the structure that results from inserting the following numerical keys into each of the structures given, starting from an empty structure. Keys: 17 29 25 48 9 36 3 31 (a) Heap (min heap) (b) Hash table of size 11, using double hashing with primary hash function h(x) =x mod 11 and secondary hash function d(x) = 5 − (x mod 5) (c) AVL Tree

  • 5. Draw the hash table that results using the hash function: h(k)=kmod13 to hash the keys...

    5. Draw the hash table that results using the hash function: h(k)=kmod13 to hash the keys 18, 41, 22, 44, 59, 32, 31, 73. Assuming collisions are handled by Double hashing. ['M' is '7' which is less than the HTS and the hash function does not evaluate to '0'].

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