Question

In: Computer Science

Suppose we have a sequential ordered file of 200,000 records, where each record is 200 bytes....

Suppose we have a sequential ordered file of 200,000 records, where each record is 200 bytes. Assume blocksize = 2048 bytes (10 records per block), average seek time = 10 ms, average rotational delay = 8.3 ms, and block transfer time = 0.8 ms. Suppose we want to make X independent random record reads from the file. This could be done in two different approaches.

  1. read the entire file once and look for the X records of interest
  2. use a binary search to find a particular record, and repeat this for all X records of interest.

The question is to decide when it would be more efficient to perform approach 1 versus approach 2. That is, what is the value for X when an exhaustive read of the file is more efficient than X binary searches? Develop this as a function of X. Show your work! (A graph would be helpful.)

Solutions

Expert Solution

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

Kindly revert for any queries

Thanks.


Related Solutions

Suppose that we are using extendable hashing on a file that contains records with the following...
Suppose that we are using extendable hashing on a file that contains records with the following search-key values: (2, 3, 5, 7, 11, 17, 19, 23, 29, 31). Show the final extendable hash structure for this file if the hash function is h(x) = x mod 8 and buckets can hold three records. Recall that: 1. the bucket address table is indexed by the prefix of the binary representation of h(x). 2. Initially i = 0, i.e. the prefix consists...
Create a table with a minimum of 10 Records. Each Record should have a Minimum of...
Create a table with a minimum of 10 Records. Each Record should have a Minimum of 8 fields, one of which should be a phone, one a birth date and 1 (Memo) a long Text. Don't forget a Key Field Using Microsoft Access
Suppose we have an input file that contains information about how many hours each employee of...
Suppose we have an input file that contains information about how many hours each employee of a company has worked. The file looks like the following (Employee's name, Hours): John 6.5 9.5 7.25 9 8.55 Oscar 12.5 13.5 14 16 18.75 Judith 7 7 7 ••• Construct a program that reads this file and calculates the total number of hours worked by each individual. Make sure that the program handles each specific exception that could occur.' python
For each of the following file processing operations, indicate whether a sequential file, indexed random file, virtual storage access method, hashing,
For each of the following file processing operations, indicate whether a sequential file, indexed random file, virtual storage access method, hashing, or pointer structure would work best. You may choose as many as you wish for each step. Also, indicate which would perform the least optimally.a. Retrieve a record from the file based on its primary key value.b. Update a record in the file. c. Read a complete file of records. d. Find the next record in a file. e....
Suppose we have an array A that contains a prime numbers from 2 to 200 in...
Suppose we have an array A that contains a prime numbers from 2 to 200 in sorted order. How many items of the array A would the binary search algorithm have to examine before concluding that 60 is not in the array A? 30 200 100 6 2- Suppose we have an array that contains 182 village name. These names are sorted alphabetically. How many names would binary search algorithm examine to locate a particular name in the array, in...
Capital injection as a screening device. Suppose we have a firm that needs $200 to invest...
Capital injection as a screening device. Suppose we have a firm that needs $200 to invest in a project that will yield a random payoff one period hence and that the lender will require 10% loan rate. The firm knows the probability distribution of the project’s cash flow, but no one else does. All that others know is that the project can be type C or type D. If it is type C, then it will yield a cash flow...
2. Suppose we have the hypothesis test H0 : µ = 200 Ha : µ >...
2. Suppose we have the hypothesis test H0 : µ = 200 Ha : µ > 200 in which the random variable X is N(µ, 10000). Let the critical region C = {x : x ≥ c}. Find the values of n and c so that the significance level of this test is α = 0.03 and the power of µ = 220 is 0.96.
We have a couple of leases, one that we record as a liability and one that...
We have a couple of leases, one that we record as a liability and one that we do not. How will this new lease requirement impact us? They also talked about adopting early. I may be interested in early adoption. What would we need to do to implement this change this year? Upon investigation of Victory's records, you found that Victory had had two leases. One that is currently being accounted for as a capital lease and one being treated...
Java. Given an input file with each line representing a record of data and the first...
Java. Given an input file with each line representing a record of data and the first token (word) being the key that the file is sorted on, we want to load it and output the line number and record for any duplicate keys we encounter. Remember we are assuming the file is sorted by the key and we want to output to the screen the records (and line numbers) with duplicate keys. We are given a text file and have...
IP Security and IPSec Suppose you have an IPv4 packet with 825964 bytes length. Assume that...
IP Security and IPSec Suppose you have an IPv4 packet with 825964 bytes length. Assume that this packet is to be sent through a network having 1500 bytes MTU. Question: (a) How many minimum fragments must be created from the IP packet? (b) What would be the value of “flag” and “offset” fields of the first fragment? Justify your answer. (c) What would be the value of “flag”, “offset”, and “length” fields of the last fragment? Justify your answer. (d)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT