What patterns would hash to the same location

Assignment Help Basic Computer Science
Reference no: EM131076246

The success of a hash-table implementation of the ADT dictionary is related to the choice of a good hash function. A good hash function is one that is easy to compute and will evenly distribute the possible data. Comment on the appropriateness of the following hash functions. What patterns would hash to the same location?

a. The hash table has size 2,048. The search keys are English words. The hash function is

h ( key ) (Sum of positions in alphabet of key's letters) mod 2048

b. The hash table has size 2,048. The keys are strings that begin with a letter. The hash function is

h ( key ) (position in alphabet of fi rst letters key ) mod 2048
Thus, "BUT" maps to 2 .How appropriate is this hash function if the strings are random? What if the strings are English words?

c. The hash table is 10,000 entries long. The search keys are integers in the range 0 through 9999. The hash function is

h ( key ) ( key* random ) truncated to an integer
Where random represents a sophisticated random-number generator that returns a real value between 0 and 1.

d. The hash table is 10,000 entries long (HASH_TABLE_SIZE is 10000). The search keys are integers in the range 0 through 9999. The hash function is given by the following C++ function:

2492_9d2fd0ff-4264-488b-b45a-844e89a348a4.png

Reference no: EM131076246

Questions Cloud

Force multiplier or something to be avoided : 1. What is the definition of stress? Do you feel that stress is a force multiplier or something to be avoided? Explain.
Describe an efficient implementation for these operations : Describe an efficient implementation for these operations.
Determine the cdf and sketch it : Let X denote the temperature at which a certain chemical reaction takes place. Suppose that X has pdf
Classify the implicit meanings of digital content : classify the implicit meanings of digital content, which in turn drive business processes, enterprise knowledge, business rules, and enterprise application interoperability.
What patterns would hash to the same location : The hash table is 10,000 entries long (HASH_TABLE_SIZE is 10000). The search keys are integers in the range 0 through 9999. The hash function is given by the following C++ function:
Do you think divided government preferable to party control : Discuss whether there is a division of party control in your state's executive and legislative branches. Do you think divided government is preferable to unified party control? Why or why not?
Revealing all e-mail addresses to entire group of recipients : Owen is sending an e-mail message to a list of receivers. What is the most efficient way he can send the same message but avoid revealing all e-mail addresses to the entire group of recipients?
Compute the area of the image of s under the mapping : MATH 54 QUIZ 3. Compute the determinant of the following matrix. Compute the area of the image of S under the mapping x |→ Ax
Write pseudo code for a replace function at the client level : write pseudo code for a replace function at the client level that replaces the dictionary item whose search key is x with another item whose search key is also x .

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Insufficient evidence to support the claim

Step on how to confirm using a test procedure and (alpha) level of 0.01 that there is insufficient evidence to support the claim that the standard deviation is at most 0.00003. State any necessary assumption about the underlying distribution of da..

  How many bits are required in the address bus

You have been assigned to design a 8M x 32 bit memory board. You may use only 256K x 8 bit RAM chips with full parallel addressing.a) How many bits are required in the Address Bus of the whole board?

  Proposals coming from contractors who have unique skills

Proposals coming from contractors who have unique skills in providing goods and services are called:    a. best and final offers (BAFOs)    b. negotiated proposals

  Deprecated expense and accumulated depreciation

What is the difference between deprecated expense and accumulated depreciation?

  Select appropriate variable

1. (TCOs 1-8) NOTE: YOU DO NOT have to compile/run this code in eclipse. You are writing the code here only. Write a class called point that has attributes and methods to model an (x,y) coordinate in a 2-D environment. Select appropriate variable(s..

  Create memo for management-accounting information systems

Create a memo to your management in which you address significance of accounting information systems. Give some main features of accounting information system.

  Linda who works for an intelligence company

Linda who works for an intelligence company is suspected of accessing and possessing digital content pertaining to turtles. Accessing, possessing, or distributing of digital content pertaining to turtles breaches both civil and criminal laws. Linda h..

  Create folder named lastname firstname in a google drive

Creat a Google Drive account, and Create folder named Lastname_Firstname in a Google Drive account; upload A2_part3_data, rename as GICC Renovations and open in Google Sheets.

  Integrity of a system

Then provide an example where the integrity of a system is more important than the confidentiality or availability of that system. Finally, provide an example of a system where the availability of a system is more important than the confidentialit..

  Create a console-based program and a gui application

create a console-based program and a GUI application, which justifies the following conditions: The Main() method prompts the user for an integer value and, in turn, passes the value to a method that squares the number and a method that cubes the ..

  How can this problem be solved

What is the source of the problem of generalizing to other experimenters? How can this problem be solved?

  A transformer has 20 primary windings 100

A transformer has 20 primary windings 100 secondary windings. If the secondary volatage is 25 V, find the primary voltage

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd