Write a program to calculate the hashing table of input data

Assignment Help Computer Engineering
Reference no: EM132208489

Question :

Write a program to calculate the hashing table of input data. The program reads from the standard input the table size k.

The program reads the data to be hashed from a text file named "input.txt".

Then it calculates the hashing table After the program reads the size k, open and reads the data from "input.txt".Then it displays some statistics and continue to read from the standard input till the end of the file (standard input).

The "input.txt" file consists of records (strings, and may contain spaces) each record is in a separate line. Note that the space is a part of the record to be hashed.

You can assume that the maximum record length is 50 and the maximum value for k is 256

The statistics to be displayed is as follows (each line terminated by a new line).

• The number of entries with collision is xxx (xxx is an integer left justified in 5 digits, note there is a space between is and the first digit), where a collision is a tabel entry that received.

• The number of unused entries is xxx (again xxx is an integer left justified in 5 digits, the unused entries are the entries in the k -length table where no strings are mapped).

Sample input.txt (7 lines), k=10

this is a test file for b4 a smll file but could be effective aaaaa sdfghj

Sample output:

The number of entries with collision is 1 The number of unused entries is 4

Reference no: EM132208489

Questions Cloud

Write a program in c that simulates a soft drink machine : Each time a program runs, it should load the data from the file and enter into a loop that displays the list of drinks and their cost on the screen.
Write the function using a loop and without a loop : Add a main to each of the two programs to fully test them out and do at least 5 test run for each program.
Draw the indifference curves and budget line of that worker : Assume optimum labor time of a worker is positive. Draw the indifference curves and budget line of that worker. Show the optimum level of his labor time.
Calculate the greatest common divisor of any finite set : Write a program to calculate the greatest common divisor of any finite set of integers.
Write a program to calculate the hashing table of input data : Write a program to calculate the hashing table of input data. The program reads from the standard input the table size k.
How much higher or lower is the price level : Assume real wage in the USA is 40$, in Mexico, it is 25$ in 2000. Also, assume the nominal wage in the two countries is the same.
Write java statements that output to the console : The output lists each number in the file and displays which of the four properties hold true for that number.
Creating a brand identity using given information : People connect through stories. Storytelling is an effective way to create and sell a brand image. Choose a known brand and discuss the brands story.
How much are you reducing the other villagers profits : If you add an 8th cow, how much are you reducing the other villagers' profits? (hint: calculate their individual profits when there are 7 cows.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What are base cases for recursive binary search algorithm

In printing the components of an array recursively, what is the base case? What are the base cases for the recursive binary search algorithm?

  Write an algorithm which counts the number of vertices

Write an algorithm which counts the number of vertices having the same value x of a connected graph.

  How should dsi assess risk of adopting a cloud-based osds

What model should DSI adopt for a cloud-based OSDS - how should DSI assess the risk of adopting a cloud-based OSDS?

  What is the flow process in the customer every hour

What is the flow process in the customer every hour? Assuming unlimited demand, what is the new flow rate if the center adds the server to bottleneck resource?

  How does holy spirit work within us as believers

In examining Albert Bandura: Social Cognitive Theory, "Internal Factors in Self-Regulation". There are three main factors presented (1) Self-observation, (2) Judgmental Processes, (3) Self-Reaction in answering this what does God's Word teach us a..

  Script that will repetitively ask user for a binary number

write a script that will repetitively ask the user for a binary number and return its decimal equivalent until an illegal number (one containing digits other than 0 or 1) is entered.

  Write a function which takes as inputs two vectors

Write a function which takes as inputs two vectors x and y of arbitrary, but equal, size and outputs a vector which contains all of the elements.

  Display the values of the new list on screen

Read each value from the Stack and multiply its value by 7. Store each of the new values to either a Queue (linked list) or a Priority.

  How unix permissions can be regarded as access control lists

Explain how UNIX permissions can be regarded as access control lists. Contrast access control lists and capability-based access control.

  What are advantage of using xml rather than binary encodings

What are the advantages and disadvantages of using XML rather than binary encodings?

  Is it feasible for an attacker to derive m from h

Suppose h=H(m), where H is a cryptographic hash function. Is it feasible for an attacker to derive m from h?

  What is an escape sequence

What is an escape sequence? Name three escape sequences used by the echo command, and explain the significance of each.

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