Question

#1 [8 points) Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and chaining is used to reso

It should be really short and simple to do this.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1 20,42,45,49,62,72,95 and N. hikey) - Key mod N o h (20) = 20 mod 11=9 h242) = 42 modul 9 -> collision occur maintain separathen insert the key 45 Linear probing :- If the collision occur in next position. hekey) = key modN. hc20) = 20 mod 1129 he42
Add a comment
Know the answer?
Add Answer to:
It should be really short and simple to do this. #1 [8 points) Sketch a hash...
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
  • #3 [3 points] Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and quadratic probing is used to resolve collisions, after the following elements are inserted: 20, 42,...

    #3 [3 points] Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and quadratic probing is used to resolve collisions, after the following elements are inserted: 20, 42, 45, 49, 62, 72, 95. The probes are based on this equation: (H+c1∗i+c2∗i2)mod(N) and c1=1, c2=1. If direct hashing was used to store the same elements as the previous problems (20, 42, 45, 49, 62, 72, 95), what should be the minimum size of...

  • Separate Chaining A hash table of size 7 uses separate chaining to resolve collisions. A polynomial...

    Separate Chaining A hash table of size 7 uses separate chaining to resolve collisions. A polynomial hash function where a 33 is used. Sketch the table's contents after the following words have been added in the exact order shown: find, edge, body, race, plan, beat, they You may find it useful to create a list of lowercase letters and their ASCII numeric value. The letter a's value is 97 and z's value is 122. Linear Probing: A hash table of...

  • Need help on problems 3 and 4 only thanks in advance. Define the following terms: hash...

    Need help on problems 3 and 4 only thanks in advance. Define the following terms: hash table hash function perfect hash function What is a collision? Explain three ways of handling collisions (a program is not needed; a clear brief explanation suffices). Consider a hashing scheme that uses linear probing to resolve collisions. Design an algorithm (no code necessary) to delete an item from the hash table. What precautions do you need to take to make it work properly? Given...

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

  • ^b Given input( 66, 28, 43, 29, 44, 69, 19) and a hash function h(x) =...

    ^b Given input( 66, 28, 43, 29, 44, 69, 19) and a hash function h(x) = x mod 10, show the resulting hash table 1) Using Separate Chaining 2) Using Linear Probing 3) Using Quadratic Probing 4) Starting with the following hash function: h2(x) 7- (x mod 7), applv Rehash ary course slides ing as described in the prim Rehashing Increases the size of the hash table when load factor becomes "too high" (defined by a cutoff) - Anticipating that...

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

  • 11. Dra The size The hash function used is: the contents of the 13 hash tables...

    11. Dra The size The hash function used is: the contents of the 13 hash tables below. Show your work for partial r hash table is HOk)-k mod 7 13, 17, 6, 24, 3 a) Resolve collisions with chaining b) Double hashing, where W20)-7-0mod 5) 0 1 1 2 2 3 3 4 4 5 5 6 6 c) What is the load factor for the table a? d) What is the load factor for the table b? f) Is...

  • Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x...

    Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x (mod () 10), show the resulting: a. Separate chaining hash table b. Hash table using linear probing c. Hash table using quadratic probing d. Hash table with second hash function h2(x) = 7 - (x mod 7) *Assume the table size is 10.

  • Assume data is to be stored in a hash table using the following keys: 62,77.26, 42,...

    Assume data is to be stored in a hash table using the following keys: 62,77.26, 42, 52,76 Assume the hash table size is 7, the hash function used is the modulo function i.e. h/key) = key % table_size, and collisions are handled using linear probing. What's the content of the table after all keys are mapped to the hash table? (List keys starting from table index 0 and on Separate numbers by a comma and a single space, and indicate...

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

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