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

  Algorithm to read an arbitrary number

Develop an algorithm to read an arbitrary number of the data records, each consisting of a name, age, and code. A Code of 1 will indicate female, a code of 2 will indicate male.

  Write a program that will collect data from bluetooth device

Using arduino, write a program that will collect data from Bluetooth devices and store the information in a database.

  Health care services

Compare and contrast the cost-effectiveness, benefit-cost, and cost-utility analysis and find which is most useful to assess value of the health care services overall.

  Questionexecute a recursive directory traversal as walking

questionexecute a recursive directory traversal. as walking the file tree you will be looking for duplicate files and

  Problem on c program

Write down a C program that displays a title, "Currency Conversion", and then writes the names of 5 currencies and their equivalents to a US dollar. The conversions are hard coded equations.

  List three different implementations of queues

List three different implementations of queues. Explain the difference between has-a and is-a relationships between classes. Define the term simulation.

  What are some of the configuration options

The servers will have static IP addresses. What should you install on one of the servers, and what are some of the configuration options?

  What are the differences between policies

What are the differences between policies, standards and guidelines. Provide specific examples of these differences

  Describe how to process such a drug order of k requests

Describe how to process such a drug order of k requests so that it can be fulfilled in O(k log(n/k)) time, assuming the bottle sizes are stored.

  Write a function that will compute n factorial

Write a function that will compute N! ( factorial) for a single integer N read in from data file. Your function should print N!.

  What is the size of each individual direct-mapped cache

What is the size of each individual direct-mapped cache? Give your answer in address space x addressability form.

  Explaining the binary tree

The left spine of the binary tree is a path starting at root and following only left-child pointers down to a leaf. State the expected number of nodes in left spine of an n-node treap. What is the expected number of leaves in an n-node treap?

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