Asked Feb 29, 2020

Suppose that a computer has only the memory locations 0,1,2,...,19.  Use the hashing functionh where h(x)=(x+5) mod 20 to determine the memory locations in which 57, 32, and 97 are stored.


Expert Answer

1 Rating
Step 1

Memory location using hash function

A hash function is a function that takes one number as input and the other as output. The output is used as an index into the storage location which is similar to an array. Here the hash function is h(x) = (x + 5) mod 20

The first value to be stored in memory is 57. The hash value of 57 is

h (57) = (57 + 5) mod 20 = 62 mod 20 = 2.

Here ...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: You are using a new release of an application software package. You think that you have discovered a...

A: Application software are the software program used for solving a problem or doing any specific tasks...


Q: Draw the hierarchy chart and design the logic for a program that calculates service charges for Haze...

A: The hierarchy chart is shown below: Main Prompt user for customer last name, number of bathrooms a...


Q: PART A. Write a program NumberShape that asks the user to enter a single-digit number and outputs th...

A: Program Explanation- Note- Your last four lines of the code are incorrect.The correct code is shown ...


Q: Write Java code to define a class called Product containing the followinginformation: name, price, a...

A: Note: Since we have defined  both the variables name and price as private, so we have made two acces...


Q: What symbol is used in UML to denote inheritance? Group of answer choices a filled square a fille...

A: UML: UML stands for Unified Modeling Language. UML is an object-oriented analysis and design languag...


Q: What is the difference between a static website and a dynamic one?

A: Static Website – A simple website created using an HTML and released to the web server is a static w...


Q: Consider a state space where the start state is number 1 and the successor function for state n retu...

A: a) Since the state space starts from state number 1 and the successor function for state n returns t...


Q: In general, there are two types of grammars for programming languages, regular and context-free, wha...

A: The lexical rules in the case of regular grammar are simple and the notations are quite easy to unde...


Q: How does a network-based IDS differ from a host-based IDS?

A: Click to see the answer