1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
erica [24]
3 years ago
10

It takes 2 seconds to read or write one block from/to disk and it also takes 1 second of CPU time to merge one block of records.

Assume that all input, output, and CPU processing is sequential and there is no waiting time. The block size is 100 records. a) (7) Give an optimal 4-way merging scheme to merge the 6 runs into 1. b) (7) What is the total time taken by the optimal scheme

Computers and Technology
1 answer:
Alexxx [7]3 years ago
5 0

Answer:

Part a: For optimal 4-way merging, initiate with one dummy run of size 0 and merge this with the 3 smallest runs. Than merge the result to the remaining 3 runs to get a merged run of length 6000 records.

Part b: The optimal 4-way  merging takes about 249 seconds.

Explanation:

The complete question is missing while searching for the question online, a similar question is found which is solved as below:

Part a

<em>For optimal 4-way merging, we need one dummy run with size 0.</em>

  1. Merge 4 runs with size 0, 500, 800, and 1000 to produce a run with a run length of 2300. The new run length is calculated as follows L_{mrg}=L_0+L_1+L_2+L_3=0+500+800+1000=2300
  2. Merge the run as made in step 1 with the remaining 3 runs bearing length 1000, 1200, 1500. The merged run length is 6000 and is calculated as follows

       L_{merged}=L_{mrg}+L_4+L_5+L_6=2300+1000+1200+1500=6000

<em>The resulting run has length 6000 records</em>.

Part b

<u><em>For step 1</em></u>

Input Output Time

Input Output Time is given as

T_{I.O}=\frac{L_{run}}{Size_{block}} \times Time_{I/O \, per\,  block}

Here

  • L_run is 2300 for step 01
  • Size_block is 100 as given
  • Time_{I/O per block} is 2 sec

So

T_{I.O}=\frac{L_{run}}{Size_{block}} \times Time_{I/O \, per\,  block}\\T_{I.O}=\frac{2300}{100} \times 2 sec\\T_{I.O}=46 sec

So the input/output time is 46 seconds for step 01.

CPU  Time

CPU Time is given as

T_{CPU}=\frac{L_{run}}{Size_{block}} \times Time_{CPU \, per\,  block}

Here

  • L_run is 2300 for step 01
  • Size_block is 100 as given
  • Time_{CPU per block} is 1 sec

So

T_{CPU}=\frac{L_{run}}{Size_{block}} \times Time_{CPU \, per\,  block}\\T_{CPU}=\frac{2300}{100} \times 1 sec\\T_{CPU}=23 sec

So the CPU  time is 23 seconds for step 01.

Total time in step 01

T_{step-01}=T_{I.O}+T_{CPU}\\T_{step-01}=46+23\\T_{step-01}=69 sec\\

Total time in step 01 is 69 seconds.

<u><em>For step 2</em></u>

Input Output Time

Input Output Time is given as

T_{I.O}=\frac{L_{run}}{Size_{block}} \times Time_{I/O \, per\,  block}

Here

  • L_run is 6000 for step 02
  • Size_block is 100 as given
  • Time_{I/O per block} is 2 sec

So

T_{I.O}=\frac{L_{run}}{Size_{block}} \times Time_{I/O \, per\,  block}\\T_{I.O}=\frac{6000}{100} \times 2 sec\\T_{I.O}=120 sec

So the input/output time is 120 seconds for step 02.

CPU  Time

CPU Time is given as

T_{CPU}=\frac{L_{run}}{Size_{block}} \times Time_{CPU \, per\,  block}

Here

  • L_run is 6000 for step 02
  • Size_block is 100 as given
  • Time_{CPU per block} is 1 sec

So

T_{CPU}=\frac{L_{run}}{Size_{block}} \times Time_{CPU \, per\,  block}\\T_{CPU}=\frac{6000}{100} \times 1 sec\\T_{CPU}=60 sec

So the CPU  time is 60 seconds for step 02.

Total time in step 02

T_{step-02}=T_{I.O}+T_{CPU}\\T_{step-02}=120+60\\T_{step-02}=180 sec\\

Total time in step 02 is 180 seconds

Merging Time (Total)

<em>Now  the total time for merging is given as </em>

T_{merge}=T_{step-01}+T_{step-02}\\T_{merge}=69+180\\T_{merge}=249 sec\\

Total time in merging is 249 seconds seconds

You might be interested in
Which of the following arguments are valid? Explain your reasoning
klio [65]

Answer:

a) the Statement is Invalid

b) the Statement is Invalid

Explanation:

a)

lets Consider, s: student of my class

A(x): Getting an A

Let b: john

I have a student in my class who is getting ab A: Зs, A(s)

John need not be the student i.e b ≠ s could be true

Hence ¬A(b) could be true and the given statement is invalid

b)

Lets Consider G: girl scout

C: selling 50 boxes of cookies

P: getting prize

s: Suzy

Now every girl scout who sells at least 50 boxes of cookies will get a prize: ∀x ∈ G, C(x) -> P(x)

Suzy, a girl scout, got a prize: s ∈ G, P(s)

since P(s) is true, C(s) need not be true

Main Reason: false → true is also true

Therefore the Statement is Invalid

7 0
2 years ago
Random integer between 3 and 13 (inclusive)
garri49 [273]

Answer:

6

Explanation:

5 0
2 years ago
Read 2 more answers
What is the minimum number of bits required to store 11 different values?
yawa3891 [41]

Answer:

4 bits are required. 4 bits can represent 16 different values (2*2*2*2 or ). 3 bits can only represent 8 different values. In the general case n bits can represent values, or correspondingly m values can be represented by bits.

5 0
3 years ago
What does a proxy server do?
Otrada [13]

I believe your answer would be C, but that also falls under a VPN.


8 0
3 years ago
Read 2 more answers
1,
sashaice [31]

Answer:

Match the methods:

See attached file

---------------------------------------------------------------------------------------------------------------------------------------

2)

Methods are public, and instance variables are private in common pattern of a class definition program.

So, the correct option is (C).

- -----------------------------------------------------------------------------------------------------------------------------------------

3) Java code:

//Create a Throttle called quiz with 100 positions<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Throttle quiz = new Throttle(100);

//Method that shifts quiz's flow to the halfway

quiz.shift(50);

//Display the current flow from quiz.

System.out.println(quiz.getflow());

-------------------------------------------------------------------------------------------------------

4)

Assume that the Foo class does not have a clone method. Then x is set to refer to a copy of y's object for an assignment x=y; in two Foo objects

.

So, the correct option is (A)

-----------------------------------------------------------------------------------------------------------------------------------------

5)

The correct option is

A)

mower.top and copter.top will always be two separate instance variables.

Explanation:

8 0
3 years ago
Other questions:
  • In the software development life cycle, what is the role of participants in the planning phase? The participants’ role in the pl
    6·1 answer
  • You are an interior decorator, confronted with a dark living room. To lighten the room up, you have n candles and want to build
    12·1 answer
  • In ancient times what did kings and tribals chiefs use to communicate
    10·1 answer
  • ? Question
    6·2 answers
  • How do you use VMware Fusion to make a Tip Calculator?
    10·1 answer
  • . Write programming code in C++ for school-based grading system
    8·1 answer
  • Give one (1) advantage and one(1) disadvantage of using and integrated software package over a custom written one.
    15·1 answer
  • What are the components of computer system??<br>​
    10·2 answers
  • Take any software or Application that you have recently purchased, this can be a video game or any other application helping you
    7·1 answer
  • A(n) ____ is a live internet presentation that supports interactive communications between the presenter and the audience.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!