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

  Create the data model segment for business rules

The FlyRight Aircraft Maintenance (FRAM) division of FlyRight Company (FRC) does all maintenance for FRC's aircraft. Create the data model segment which reflects the following business rules.

  How different backgrounds work with the fonts

Your presentation should include information about font size and icons, how they look with different backgrounds, and how different backgrounds work with the fonts.

  What are areas addressed in cbk

What are the areas addressed in the CBK? Was policy explicitly listed? If not, where do you feel it is addressed in the CBK?

  Which areas are similar to those covered in the nist

Visit the U.S. Postal Service web site https://about.usps.com/handbooks/as805.pdf. Review the content page for this extensive manual. Compare this program to the (National Institute of Standard Technology) . Which areas are similar to those covered i..

  Estimate the maximum compaction attainable in the landfill

Estimate the maximum compaction attainable in the landfill

  Business benefits that especially for you jewelers company

A technical term paper that I need done. Please include title page and reference page with references. This term paper needs to be in APA style. Include page numbers at the top right corner of each page.  The title page includes: title, name, date, c..

  Cryptographic tunneling and the osi model

Write a paper consisting of 500-1,000 words (double-spaced) on the security effects of cryptographic tunneling based on an understanding of the OSI (Open Systems Interconnect) model.

  Determine the frequency of failure

Collect Experimental Data. Bend the provided 30 paper clips until they fail.

  Non­resetting finite state machine

Design a Mealy, non­resetting finite state machine that has one binary input X and one binary output Z. The output Z = 1 occurs whenever the last five bits on input X have been 11101; otherwise, the output Z = 0. This machine recognizes overlapping s..

  Performance of receiver-initiated load sharing algorithm

Predict the performance of receiver-initiated load sharing algorithm when entire system workload is generated at only a few nodes in the system instead of equally.

  Compare this with existing distance-vector router learning

Assume that routers only receive new-network notices from other routers, and that the originating routers receive their IP network information via configuration

  Write a recursive method that returns the total number

Write a recursive method that returns the total number of handshakes that took place in a room with n people.

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