Write a program to calculate the hashing table of input data

Assignment Help Computer Engineering
Reference no: EM132196196

Write a C program. Hashing Table from input.

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: EM132196196

Questions Cloud

Prepare a program to display the sum array : Write a C program that inputs 5 elements into each of 2 integer arrays. Add corresponding array elements, that is array1[0] + array2[0], etc.
Find the fibonacci series using recursion : Write a C program to find the Fibonacci series using recursion. The user inputs a 64-bit non-zero positive integer n.
Generate sales-report files for set of traveling salespeople : Write a C++ program that generates sales-report files for a set of traveling salespeople.
Discuss immigration trends that accurrsd in your stats : Discuss immigration trends that accurrsd in your stats bsmssn EDIE-U and 200? and make suggestians far dealing with issues arising from same at these trends.
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.
Determine the evolution of the concentration : Determine the evolution of the concentration of A within the container. In the second part, repeat it but this time consider that A reacts with B according
Was communism in many ways no different than nazism : 1. Was Communism in many ways no different than Nazism? Discuss.
Why did japanese soldiers fight to the death : How did Social Darwinism play into German policy towards the Jews and other subject peoples?
Uses a switch statement to compute your last semester gpa : Write a program that uses a do... while loop to display all the even numbers from 1 to 30.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Comprise the demerits of not seeing the customer

write a 200- to 300-word response to the following local computer support provides an over-the-phone experience for the

  Write ada program that will input a two letter abbreviation

Develop a top-down design and write an Ada program that will input a twoletter abbreviation for one of the 50 states and print out the full name of the state.

  Design a generic post-implementation evaluation form

Create a one page questionbaire to distribute to users in a post-implementation evaluation of a recent information system project.

  Create a parse tree that shows that the string can be

A string of characters belongs to a language defined by a grammar, we must create a parse tree that shows that the string can be generated by the grammar.

  Write a program to generate a series of pseudo random number

You will write a program to generate a series of pseudo random numbers, using a linear feedback shift register method. You will start with an arbitrary number (not zero) x with a representation in n bits.

  How does the surface temperature vary

Let air at a constant velocity of 15mis, a temperature of 300°C, and 1 atm pressure flow along a smooth, flat surface. Let the first 15 cm of the surface.

  Write a method to translate an expression from postfix

Write a method to translate an expression from postfix form into prefix form. Use the C++ conventions of this chapter.

  Show output from the amazon web service

make Use of Visual Studio.NET 2005 to create an ASP.NET application that displays output from the Amazon web service. Add good documentation to the code. Furthermore, create a user-friendly interface.

  Devise an optimal inventory policy for the eoq model

Devise an optimal inventory policy for the EOQ model with a finite time horizon TH.

  Assume the javascript variables greeting

Write down a line of code to replace line 3 above which will create a greeting 'Hello Earthling!' with a space in between 'Hello' and 'Earthling' and an exclamation mark at the end.

  Write a regular expression to match a valid us phone number

Write a regular expression to match a valid US phone number, assuming there are two acceptable formats: (315)1234567, (800)123-4567.

  Write a routine to implement quaternion rotations

Write a routine to implement quaternion rotations, tor any specified axis. Develop an algorithm for scaling an object defined in an octree representation.

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