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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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