Question

Question 8: (a) We create a Hash Table of size 7, using open addressing and linear probing with the hash function h(n)=n%7. Write the content of the array after inserting the following values in sequence: 11, 28,46, 7,67, 88,0. (3 marks) . loj [1] [2] [3] [41-5] 问 (b) Explain the issue linear probing has and how it can be addressed. (3 marks)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Que 8(a):

Que 8(b):

Add a comment
Know the answer?
Add Answer to:
Question 8: (a) We create a Hash Table of size 7, using open addressing and linear...
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
  • Implement a StringHash class using python using open addressing and linear probing, it should contain the following methods: Using strings for the data 1. StringHash(size) — create a new hashTable wit...

    Implement a StringHash class using python using open addressing and linear probing, it should contain the following methods: Using strings for the data 1. StringHash(size) — create a new hashTable with a default size of 11 for your array, but allow the user to specify an alternate size if desired 2. addItem(string) — place value into the hashTable iv. bool PindItem(string value) — return true if the value is present, else false 3. findItem(string value) — return true if the...

  • True or False? 1. Duplicate hash codes create collisions. 2. In open addressing with linear probing,...

    True or False? 1. Duplicate hash codes create collisions. 2. In open addressing with linear probing, a successful search for an entry that corresponds to a given search key could potentially follow a different probe sequence used to add the entry to the hash table. 3. Completely balance binary trees are not necessarily full. 4. A preorder traversal of a binary tree is an example of a depth-first traversal.

  • Suppose we are inserting strings into a hash table of size 9. Suppose we have two...

    Suppose we are inserting strings into a hash table of size 9. Suppose we have two hash functions, h, and h2. The hash values for certain strings of these functions are shown in the table below: Fill in the hash table below assuming that we are using open-address, linear-probing style hashing, given that the table starts as it appears below, the hash function is h_1 and the order of insertion is "Fred", "Chloe", "Adam", "Rebecca" and "Reggie". Fill in the...

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

  • Part 5. Suppose that your hash function resolves collisions using the open addressing method with double...

    Part 5. Suppose that your hash function resolves collisions using the open addressing method with double hashing. The double hashing method uses two hash functions h and h'. Assume that the table size N = 13, h(k) = k mod 13, h'(k) = 1 + (k mod 11), and the current content of the hash table is: 0 1 2 3 6 7 8 9 10 11 12 4 17 5 98 If you insert k = 14 to this...

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

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

  • This should be in Java Create a simple hash table You should use an array for...

    This should be in Java Create a simple hash table You should use an array for the hash table, start with a size of 5 and when you get to 80% capacity double the size of your array each time. You should create a class to hold the data, which will be a key, value pair You should use an integer for you key, and a String for your value. For this lab assignment, we will keep it simple Use...

  • Linear Hash Table 2. In this first question you will apply the specified operations to instances...

    Linear Hash Table 2. In this first question you will apply the specified operations to instances of LinearHashTable (i.e., hash tables that use the "linear probing" approach as it was discussed in class). When such a hash table is first created, it has dimension 1 and an initial length of 2, and subsequent operations might require that the underlying array be resized, so for each of the questions below, start with the hash table specified and demonstrate (by drawing the...

  • Show how the following data would be stored in a hash table of size 7 (the...

    Show how the following data would be stored in a hash table of size 7 (the size is fixed) using quadratic probing. If any insertion fails, indicate that, but keep trying to insert all the remaining data. The hash function is hash(x) = x mod 7. Here is the data to be stored: 17, 10, 31, 45, 3, 53, 14. Insert the data in the order given. Data: Index: 0 1 2 3 4 5 6 4 data: Index: 31...

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