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

  Distinguish between a prime and a composite integer

Distinguish between a prime and a composite integer. Define the meaning of relatively prime (co-prime). Define the given functions and their application.

  Define the multiple-output qm procedure

Use the multiple-output QM procedure to simplify the functions in problem. Compare the complexity of this implementation to the one in problem.

  Program utilizing small basic

Write down a program utilizing the Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum should be less than secondNum). Then utilizing the firstNum and secondNum:

  Compare and contrast two life cycle models

Your team is working on a software application project to create a mobile application that allows customers to reserve tables at local restaurants.

  Determine technology which has changed cafe,coffee shop

Determine technology which has changed cafe,coffee shop? Think things such as marketing, food preparation, inventory ordering or re-ordering, customer tracking, and more.

  How are traditional security monitoring and investigatory

How are traditional security monitoring and investigatory practices such as auditing and forensics affected by having data.

  What is the syntax of a for statement in the bash script

Write a snippet of code using a for loop that will write numbers less than 100 that are evenly divisible by both two and three.

  Describe how to modify the skip list data structure

Describe how to modify the skip list data structure to support the method atIndex(i), which returns the position of the element in the "bottom" list S0.

  List the binary values in register a and the carry flip-flop

Register A holds the binary number 0101 and register B holds 0111. The carry flip-flop is initially reset to 0. List the binary values in register A and the carry flip-flop after each shift.

  Here the interface id remains set at the 48 bits normal for

discuss the advantages and disadvantages of constructing ipv6 addresses directly from ipv4 addresses by adding the 32

  Discuss how the topology can be used

Discuss how the topology can be used

  Design the corrected third refinement of the sequential file

Consider the effect of introducing lookahead to the design of the corrected third refinement of the sequential master file update problem.

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