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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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