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

Storing a sparse matrix in memory, Explain an efficient method of storing a...

Explain an efficient method of storing a sparse matrix in memory. Write a module to find the transpose of the sparse matrix stored in this way. A matrix which contains number o

Insertion of element into a linked list, ALGORITHM (Insertion of element in...

ALGORITHM (Insertion of element into a linked list) Step 1 Begin the program Step 2 if the list is empty or any new element comes before the start (head) element, then add t

Signals, How does cpu''s part tming and controls generate and controls sign...

How does cpu''s part tming and controls generate and controls signls in computer?

Write down the procedure to reverse a singly linked list. , Ans: A pr...

Ans: A procedure to reverse the singly linked list: reverse(struct node **st) { struct node *p, *q, *r; p = *st; q = NULL; while(p != NULL) { r =q;

Linked list, Write a program for reversing the Linked list

Write a program for reversing the Linked list

Curve, write a c++ program to find out the area of a curve y=f(x) between x...

write a c++ program to find out the area of a curve y=f(x) between x=a and x=b

File organization, Define File organization''s and it''s types

Define File organization''s and it''s types

What are the example of area subdivision method, Example of Area Subdivisio...

Example of Area Subdivision Method The procedure will be explained with respect to an illustrative problem, with the image consisting of five objects, namely a triangle (T), qu

Complexity of an algorithm, What do you mean by complexity of an algorithm?...

What do you mean by complexity of an algorithm? The complexity of an algorithm M is the function f(n) which gives the running time and/or storage space need of the algorithm i

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