Write a program to create a hashed file, Data Structure & Algorithms

Assignment Help:

Write a program to create a hashed file that stores the records currently in the file "data_2013". Records should use the same fixed-length schema given previously, and should again be written in binary.

When inserting the records into your new file, they should be hashed on the ID attribute.

Using a static hashing approach, with the hash functionID % pageswhere pages is the number of pages in the file) to determine which "page" of the file the recordsshould be stored in. For simplicity (so that you do not need to worry about the possibility ofoverflow records), assume an average occupany of 80%. (Hint: as a first step, your programshould calculate the total number of pages that there will be in your file, based on the numberof records to be stored, the occupancy, and the pagesize parameter.) You should implement this hashing algorithm yourself.


Related Discussions:- Write a program to create a hashed file

Row major storage, Q. Take an array A[20, 10] of your own. Suppose 4 words ...

Q. Take an array A[20, 10] of your own. Suppose 4 words per memory cell and the base address of array A is 100. Find the address of A[11, 5] supposed row major storage.

Proof, prove that n/100=omega(n)

prove that n/100=omega(n)

Write an algorithm to input number of passengers travelling, There are ten ...

There are ten stations on a railway line: Train travels in both directions (i.e. from 1 to 10 and then from 10 to 1).  Fare between each station is $2. A passenger input

Limitation of binary search, Limitation of Binary Search: - (i)  The co...

Limitation of Binary Search: - (i)  The complexity of Binary search is O (log2 n). The complexity is similar irrespective of the position of the element, even if it is not pres

What is assertions, What is Assertions Introduction At every point...

What is Assertions Introduction At every point in a program, there are generally constraints on the computational state that should hold for program to be correct. For ins

Define merge sort, Define Merge Sort  Merge sort is a perfect example ...

Define Merge Sort  Merge sort is a perfect example of a successful application of the divide and conquer method. It sorts a given array A[0...n-l] by separating it into two ha

What is binary search, What is binary search?   Binary search is most ...

What is binary search?   Binary search is most useful when list is sorted. In binary search, element present in middle of the list is determined. If key (the number to search)

Graph traversal schemes, Various graph traversal schemes Graph Traversa...

Various graph traversal schemes Graph Traversal Scheme. In many problems we wish to investigate all the vertices in a graph in some systematic order. In graph we often do no

String pattern matching, Document processing is quickly becoming one of the...

Document processing is quickly becoming one of the dominant functions of computers. Computers are utilized to edit, search & transport documents over the Internet, and to display d

Write Your Message!

Captcha
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