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

Quick sort method, Q. Explain quick sort? Sort the given array using quick ...

Q. Explain quick sort? Sort the given array using quick sort method. 24 56 47 35 10 90 82 31

Various passes of bubble sort, Q. Show the various passes of bubble sort on...

Q. Show the various passes of bubble sort on the unsorted given list 11, 15, 2, 13, 6           Ans: The given data is as follows:- Pass 1:-     11   15   2     13

If a node having two children is deleted from a binary tree, If a node havi...

If a node having two children is deleted from a binary tree, it is replaced by?? Inorder successor

Queue, 1. Show the effect of each of the following operations on queue q. A...

1. Show the effect of each of the following operations on queue q. Assume that y (type Character) contains the character ‘&’. What are the final values of x and success (type boole

Abstract data types, Abstract Data Types :- A useful tool for specifying th...

Abstract Data Types :- A useful tool for specifying the logical properties of a data type is the abstract data type or ADT. The term "abstract data type" refers to the basic mathem

Define a tree and list its properties, QUESTION (a) Define a tree and l...

QUESTION (a) Define a tree and list its properties. (b) By showing all your workings, draw the spanning tree for the following graph based on the Breadth-First-Search algori

Travelling salesman problem, Example 3: Travelling Salesman problem G...

Example 3: Travelling Salesman problem Given: n associated cities and distances among them Find: tour of minimum length that visits all of city. Solutions: How several

Write an algorithm for binary search., Write an algorithm for binary search...

Write an algorithm for binary search. Algorithm for Binary Search 1.  if (low> high) 2.  return (-1) 3.  Mid = (low + high)/2 4.  if ( X = = a[mid]) 5.  return (mid); 6.

Parallel implementation of the raytracer, You are supposed to do the follow...

You are supposed to do the following: Write a parallel implementation of the raytracer using pthreads. Measure and compare the execution times for (i) the sequential ver

Queues, what is queues? how it work? and why it used? i want an assignment...

what is queues? how it work? and why it used? i want an assignment on queue .....

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