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

Algorithms for push and pop operation, Q. Suggest a method of implementing ...

Q. Suggest a method of implementing two stacks in one array such that as long as space is there in an array, you should be capable to add an element in either stack. Using proposed

Flow chart, What is tha flow chart of algorithm

What is tha flow chart of algorithm

Explain linked list and its types, Data Structure and Algorithm 1. Exp...

Data Structure and Algorithm 1. Explain linked list and its types. How do you represent linked list in memory? 2. List and elucidate the types of binary tree. 3. Descr

Explain state space tree, Explain State Space Tree If it is convenient ...

Explain State Space Tree If it is convenient to execute backtracking by constructing a tree of choices being made, the tree is known as a state space tree. Its root indicates a

Representation of sets?, A set s is conveniently shown in a computer store ...

A set s is conveniently shown in a computer store by its characteristic function C(s). This is an array of logical numbers whose ith element has the meaning "i is present in s". As

Circular queues and implement circular queues using array, Explain what are...

Explain what are circular queues? Write down routines required for inserting and deleting elements from a circular queue implemented using arrays.           Circular queue:

Explain the concept of colouring, Colouring The use of colours in CAD/C...

Colouring The use of colours in CAD/CAM has two main objectives : facilitate creating geometry and display images. Colours can be used in geometric construction. In this case,

Insertion of a key into a b-tree, Example: Insertion of a key 33 into a B-...

Example: Insertion of a key 33 into a B-Tree (w/split) Step 1: Search first node for key closet to 33. Key 30 was determined. Step 2: Node pointed through key 30, is se

Demonstrate that dijkstra''s algorithm, Demonstrate that Dijkstra's algorit...

Demonstrate that Dijkstra's algorithm does not necessarily work if some of the costs are negative by finding a digraph with negative costs (but no negative cost dicircuits) for whi

Help with Assignment, Need help with Data Structures assignment requiring C...

Need help with Data Structures assignment requiring C++ program

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