write a program to simulate searching over a


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

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: write a program to simulate searching over a
Reference No:- TGS0275893

Expected delivery within 24 Hours