Search on a heap file, Data Structure & Algorithms

Assignment Help:

Consider the file "search_2013". This is a text file containingsearch key values; each entry is a particular ID (in the schema given above). You are tosimulate searching over a heap file, with different assumptions for the size of file pages.Write a program to perform equality search operations. The executable name of this program must be sHeap and it mustbe able to be executed using the command:

> ./sHeap search_2013 heap pagesize

where search_2013 is the name of the file containing the keys to be searched for; heap is theoutput file of your wHeap program; and pagesize is an integer value that specifies the size ofthe disk page that you are simulating.

Your program should read in the file, one "page" at a time. For example, if the pagesize

parameter is 100, your program should read in the first 100 records from disk. These can thenbe scanned, in-memory, for a match. If a match is found, print the matching record to stdout.You should assume that ID is a primary key. If no match is found, read in the next pagesizerecords of the file. The process should continue until either a matching record is found, or thereare no more records in the file to process.

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 always output thetotal time taken to do all the search operations in milliseconds to stdout. For example, if thetime taken to do the reading is 123:45 ms, the output would be:Time: 123.45 ms


Related Discussions:- Search on a heap file

Compound interest, Write the algorithm for compound interest

Write the algorithm for compound interest

What is Polyphase Sort, One of the best known methods for external sorting ...

One of the best known methods for external sorting on tapes is the polyphase sort. Principle: The basic strategy of this sort is to distribute ordered initial runs of predetermi

Explain the rgb model, RGB Model The RGB model is based on the assumpti...

RGB Model The RGB model is based on the assumption that any desired shade of colour can be obtained by mixing the correct amounts of red, green, and blue light. The exact hues

Add the special form let to the metacircular interpreter, (1)  (i) Add the ...

(1)  (i) Add the special form let to the metacircular interpreter Hint: remember let is just syntactic sugar for a lambda expression and so a rewrite to the lambda form is all t

Determine the space complexity of euclid algorithm, 1)      Why space compl...

1)      Why space complexity is comparatively more critical than time complexity? 2)      Determine the space complexity of Euclid Algorithm?

Explain depth-first traversal, Depth-first traversal A depth-first t...

Depth-first traversal A depth-first traversal of a tree visit a node and then recursively visits the subtrees of that node. Likewise, depth-first traversal of a graph visits

Explain first - fit method, First - Fit Method: -    The free list is trave...

First - Fit Method: -    The free list is traversed sequentially to search the 1st free block whose size is larger than or equal to the amount requested. Once the block is found it

List various problem solving techniques, List various problem solving techn...

List various problem solving techniques. There are two techniques:- 1.  Top down 2.  Bottom- up

B – trees, B-trees are special m-ary balanced trees utilized in databases s...

B-trees are special m-ary balanced trees utilized in databases since their structure allows records to be added, deleted & retrieved with guaranteed worst case performance. A B-

Pipelining., How branching takes place in Instruction pipeline. Explain wit...

How branching takes place in Instruction pipeline. Explain with suitable examples

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