24 % 13 = 11 25 % 13 = 12 50 % 13 = 11 38 % 13 = 12 12 % 13 = 12 90 % 13 = 12 Linear probing: ----------------- 0 -> 50 1 -> 38 2 -> 12 3 -> 90 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 11 -> 24 12 -> 25 Separate Chaining: ------------------- 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 11 -> 24 -> 50 12 -> 25 -> 38 -> 12 -> 90
11. (10 Points) Draw the final result after inserting keys 24, 25, 50, 38, 12, 90...
Please select file(s) Select file(s) Q9 Double 15 Points Consider inserting the keys 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m 11 using open addressing with the auxiliary hash function l'(k) = k. Illustrate the result of inserting these keys using linear probing, using quadratic probing with c1 3, and using double hashing with h1(k) = k and h2(k) = 1 + (k mod (m – 1)). See Cormen p.272 1 and...
Exercise 3 (5 points). Suppose we have a hash table of m = 9 slots, and we resolve collisions by chaining. Demonstrate what happens when we insert the keys 5, 28, 19, 15, 20, 33, 12, 17, 10. Use the division-method hash function h (k) = k mod 9.
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...
It should be really short and simple to do this.
#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 resolve collisions, when the following elements are inserted: 20, 42, 45, 49, 62, 72,95 0 1 2 3 4 5 6 7 8 9 10 What is the size of the largest bucket? — #2 [7 points) Sketch a hash table of size N=11, where...
Hash the values 94, 11, 39, 20, 16, 5, 12, 44, 13, 88 and 23 into a hash table with 11 slots. Handle collisions by linear probing. Use the hash function: h(i) (3 * i + 5) % 11 Type in each key on the same line as the index of the slot where it is eventually inserted. YOUR ANSWER TO QUESTION A: 0: 1: 2: 3: 5: 7: 9: 10:
Assume you are given a separate chaining hashtable where M=11. Give the final hashtable after adding keys: 24, 1, 4, 11, 12, 22, 33, 45, 8, 19, and 10. Use the hash function hash(k) = k mod 11, where k is the key. Include the main size M array with lists located at each index. Only include the key, not the hashed value, in your final table. Your table should look similar to the one below. Index List 0 [Key1,...
Problem 7 Given the following keys 16, 27, 52, 38, 10. 67. 56, 32, 4, 71.33, 15. Assume address is calculated by K% 17 l. (6%) Calculate the home addresses of the given keys: (4%)Show the contents of the hash table, using progressive overflow"?lysM) collisions where M 17 2. to resolve 0 10 12 13 6 14 16 (2%) Assuming that every key has the same probability number of accesses to look for a key in the table you built...
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 and hashing function is h(key) = k % 7. Show a chaining hash table after doing the insertions:
[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...
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...