Search on a hashed file, Data Structure & Algorithms

Assignment Help:

Write a program to simulate searching over a hashed file, with different assumptions for the sizeof file pages.Write a program to perform equality search operations on the hashed file produced by yourwHash program in previous section. The executable name of this program must be sHash and it mustbe able to be executed using the command:

> ./sHash search_2013 hashed pagesize

 

where search_2013 is the name of the file containing the ID keys to be searched for; hashedis the output file of your wHash program; and pagesize is an integer value that specifies thesize of the disk page that you are simulating. (Note: the pagesize parameter that you specifyfor searching should match the pagesize parameter that you used for constructing the hashedfile, otherwise your results will not make sense.)

Your program must take advantage of the assumption that hashed is a file whose structure has been created by hashing on the ID key. Your program should read in required parts of thefile, one "page" at a time. For example, if the pagesize parameter is 100, your program shouldfetch 100 records in a single read from disk. These can then be scanned, in-memory, for amatch.

If a match is found, the program must print the matching record to stdout. If no match is found, a suitable message should be printed. In addition, the program must output the total timetaken to do all the search operations in milliseconds to stdout. For example, if the time takento do the reading is 123:45 ms, the output would be:

Time: 123.45 ms


Related Discussions:- Search on a hashed file

Dgsd, Ask question #sdgsdgsdginimum 100 words accepted#

Ask question #sdgsdgsdginimum 100 words accepted#

The space - time trade off, The Space - Time Trade Off The best algorit...

The Space - Time Trade Off The best algorithm to solve a given problem is one that needs less space in memory and takes less time to complete its implementation. But in practic

Insert an element after an element pointed by some pointer, Consider a link...

Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer? O (1)

Assignment, How do I submit a three page assignment

How do I submit a three page assignment

What are the properties of colour, Properties of colour Colour descript...

Properties of colour Colour descriptions and specifications generally include three properties: hue; saturation and brightness. Hue associates a colour with some position in th

Define a procedure called make-avl-tree, This question deals with AVL trees...

This question deals with AVL trees. You must use mutable pairs/lists to implement this data structure: (a) Define a procedure called make-avl-tree which makes an AVL tree with o

Space-complexity of the algorithm, The space-complexity of the algorithm is...

The space-complexity of the algorithm is a constant. It just needs space of three integers m, n and t. Thus, the space complexity is O(1). The time complexity based on the loop

Insertion of a node into a binary search tree, A binary search tree is cons...

A binary search tree is constructed through the repeated insertion of new nodes in a binary tree structure. Insertion has to maintain the order of the tree. The value to the lef

The number of different directed trees with 3 nodes, The number of differen...

The number of different directed trees with 3 nodes are ?? The number of disimilar directed trees with three nodes are 3

Asymptotic analysis, Asymptotic Analysis Asymptotic analysis is dependi...

Asymptotic Analysis Asymptotic analysis is depending on the idea that as the problem size grows, the complexity can be defined as a simple proportionality to some known functio

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