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

  Monthly reporting form for checking account customers

As part of a larger system project. Clone Bank of Clone, Colorado, desires your help in setting up a new monthly reporting form for its checking account customers.

  Businesses today are extremely reliant on large amounts

Businesses today are extremely reliant on large amounts of data for making intelligent business decisions. Likewise, the data warehouses are often structured in a manner that optimizes processing large amounts of data.

  Discuss how server virtualization

From the e-Activity, discuss how server virtualization, architecture, and Hyper-V can create advantages and efficiencies for an enterprise, including considerations for how to decide what an enterprise should factor in when calculating Return on Inve..

  Write a program that calculates a savings accounts yearly

Write a program that calculates a savings accounts yearly savings amount. The savings account pays an interest rate of 3% yearly.

  Give the decimal values of red, green, and blue values

Give the decimal values of red, green, and blue values in the color# 33AB12.

  A virtual boolean method that indicates

Data members should include all those inherited plus any you want to add  Member functions should include any inherited methods, plus at least  A virtual Boolean method that indicates whether the player gets another card  A method that announces that..

  What happens if host a attempts to send to host b

What happens if host A attempts to connect to host B, using the virtual circuit setup mechanism discussed in the text?

  How to identify duties of the lab employees

Assume that you decide to set up a computer forensics laboratory. Submit a planning report for your lab with the following components.

  Better job of allowing computers to network

You wrote a piece of software that does a better job of allowing computers to network than any other program designed for this purpose.

  Traditional way of accomplishing the same thing

1. Write a UNIX command line that will print the number of processes that root has running on this machine. This uses pipes and is tricky. Test your answer! 2. Create a file called answers and give the following command: $ > answers.txt

  Analyze google glass

Discuss the manner in which Google Glass and its related technologies may be used by organizations in the coming years. Speculate on the major ethical or security issues that you believe come into play when using such technology

  Describe product characteristics and deliverables

Describe product characteristics and deliverables

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