Consider a file with a large number of Personid name birthda

Consider a file with a large number of Person(id, name, birth-date) records. Assume that users frequently search this file based on a the field id to find the values of name or birthdate for people whose information is stored in the file. Moreover, assume that users rarely update current records or insert new records to the file. Which file structure, heap versus sorted, provides the fastest total running time for users’ queries over this file? Explain your answer

Solution

Using the Sorted file system records must be retrieved in some order. Using Heap file structure data is not stored in order form and data will be stored in memory blocks. If we delete or update a record, first we need to search for the record then it starts from the beginning of the file until the record is fetched. So that it takes more time for searching the record. Sorted file structure gives the fastest runtime for the users for any operation on files such as addition of new records, deletion of records etc because it is in order form. The Heap file structure suitable for small files only if it is large file it takes more time for fetching a record. Using sorted file structure it gives the efficient and fastest result on operations of files, because there is a ordered nature compiler will easily scan and gets out the required position. In the heap structure it is very time consuming process to search a file in unordered memory blocks to update, delete or to add files. So that Sorted file structure gives the efficient and fastest runtime for users.
Consider a file with a large number of Person(id, name, birth-date) records. Assume that users frequently search this file based on a the field id to find the v

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site