(1) Consider inserting the keys 2, 21, 3, 58, 11, 42, 34 into a hash table...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(1) Consider inserting the keys 2, 21, 3, 58, 11, 42, 34 into a hash table of length m 10 with the hash function h(k) = k mod 10. (a) (2 points) Illustrate the result of inserting these keys using linear probing to resolve collisions. (b) (2 points) Illustrate the result of inserting these keys using chaining to resolve collisions. (2) Consider inserting the keys 8, 5, 14 into a hash table of length m = 8 with the hash function h(k) = [m(kA [kA])] where A = 0.625. (a) (2 points) Illustrate the result of inserting these keys. (b) (1 point) Now compute the hash function of the key k = 14 using the alternative algorithm described below. You can assume we have a word size w = 4. Since m = 8 = 23. p = 3. Since A = 0.625 = 10/24 = 10/2, s = 10. Alternative Algorithm: Compute ks and convert it to a bi- nary number. This number will consist of <2w bits. Look at the rightmost w bits. Of those bits, convert the leftmost p bits back to an integer. This integer is your hash table slot. (1) Consider inserting the keys 2, 21, 3, 58, 11, 42, 34 into a hash table of length m 10 with the hash function h(k) = k mod 10. (a) (2 points) Illustrate the result of inserting these keys using linear probing to resolve collisions. (b) (2 points) Illustrate the result of inserting these keys using chaining to resolve collisions. (2) Consider inserting the keys 8, 5, 14 into a hash table of length m = 8 with the hash function h(k) = [m(kA [kA])] where A = 0.625. (a) (2 points) Illustrate the result of inserting these keys. (b) (1 point) Now compute the hash function of the key k = 14 using the alternative algorithm described below. You can assume we have a word size w = 4. Since m = 8 = 23. p = 3. Since A = 0.625 = 10/24 = 10/2, s = 10. Alternative Algorithm: Compute ks and convert it to a bi- nary number. This number will consist of <2w bits. Look at the rightmost w bits. Of those bits, convert the leftmost p bits back to an integer. This integer is your hash table slot.
Expert Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these business communication questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Developments in Technology Light is incident from air on the end face of a multimode optical fibre at angle of incidence as shown below. n n 1 2 The refractive indices of the core and cladding are...
-
What is the net present value of the following cash flows if the relevant discount rate is 7 percent? 0 -11520 1 81 2 650 3 880 4 2300 5 15800
-
What are articles of incorporation and how do they differ from by-laws of a NFP organization?
-
Jian Ltd. has a unit selling price of 5,200, variable costs per unit of 2,860, and fixed costs of 1,638,000. Compute the break-even point in units using (a) The mathematical equation and (b) Unit...
-
Priscilla Webster was dining at her favorite Massachusetts seafood restaurant when matters went horribly wrong. She began choking on a fishbone that had been lurking in her seafood chowder. After a...
-
Forest City has recently implemented GAAP reporting and is attempting to determine which of the following special revenue funds should be classified as major funds and therefore be reported in...
-
Criticism of the World Bank is generally on a diverse range of issues but they generally centre around concern about the approaches adopted by the World Bank in formulating their policies, and the...
-
Design symbol table and memory and map for this code .data a1 dd 4 a2 dd ? a3 dd 5 dup(7) .code main: mov ecx, 20 Imov eax, 15 mov edx, 0 jz target_label loop1: add edx, eax imul DWord PTR [ebp + 8]...
-
Red Shoe Co. has concluded that additional equity financing will be needed to expand operations and that the needed funds will be best obtained through a rights offering. It has correctly determined...
-
Risk assessment also occurs at the financial statement level. Identify and illustrate what you consider to be significant risk areas and relevant accounting policy areas for your Auditee/Company.from...
-
Flatland Company applies fixed manufacturing overhead costs to products based on direct labor hours. Information for the month of April appears below. Flatland expects to produce and sell 18,000...
-
What is the average number of days that it takes a company to collect on its sales ?
-
Format the first occurrence of the Sale Price field with the custom name Total Sales and Currency with zero decimals.
-
A company included the following in its employee handbook: We honor confidentiality. We recognize and protect the confidentiality of any information concerning the company, its business plans, its...
-
Drainee purchases direct materials each month. Its payment history shows that 65% is paid in the month of purchase with the remaining balance paid the month after purchase. Prepare a cash payment...
-
Find all solutions to the equations x 4 (mod 5) and x 5 (mod 11).
-
Most graph algorithms that take an adjacency-matrix representation as input require time (V 2 ), but there are some exceptions. Show how to determine whether a directed graph G contains a universal...
-
Show that the class P, viewed as a set of languages, is closed under union, intersection, concatenation, complement, and Kleene star. That is, if L 1 , L 2 P, then L 1 L 2 P, L 1 L 2 P, L 1 L 2 ...
-
Salen Company finances some of its current operations by assigning accounts receivable to a finance company. On July 1, 2015, it assigned, under guarantee, specific accounts amounting to 150,000,000....
-
Bill Jovi is reviewing the cash accounting for Nottleman, Inc., a local mailing service. Jovis review will focus on the petty cash account and the bank reconciliation for the month ended May 31,...
-
On October 1, 2015, Arden Farm Equipment Company sold a pecan-harvesting machine to Valco Brothers Farm, Inc. In lieu of a cash payment Valco Brothers Farm gave Arden a 2-year, $120,000, 8% note (a...
Study smarter with the SolutionInn App