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
Learning in a digital environment is also called [blank] learning.
Dafna1 [17]

Answer:

The blank is online learning

4 0
2 years ago
Read 2 more answers
Write code that declares a variable named minutes, which holds minutes worked on a job,
Mamont248 [21]

The code that carried out the functions indicated above is stated below. It is not be noted that the code is written in C#

<h3>What is C#</h3>

C# is a type-safe, object-oriented programming language. It is pronounced "see sharp"

<h3>What is the code for the above task?</h3>

Using System;            

public class HoursAndMinutes

{

   public static void Main()

   {

      // declaring minutes variable and assigning 197 as given in question

       int minutes = 197;

     // outputing the total minutes , hours

       Console.WriteLine("{0} minutes is {1} hours and {2} minutes.", minutes, minutes/60, minutes%60);

   }

}

// OUT

Learn more about C#:
brainly.com/question/20211782
#SPJ1

8 0
2 years ago
Write a function that asks a user for his/her name and movie
Alex777 [14]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

                     

The code is written in C++

/******************************************************************************

                             Online C++ Compiler.

              Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

#include <string>  

using namespace std;

void display()

   {

       string yourName;

       string watchedMovie;

       cout<<"What is your name?  ";

       cin>>yourName;

       cout<<"Which movie have you seen?  ";

       cin>>watchedMovie;

       cout<<"Today, I have learned that  " <<name<<" watched "<<watchedMovie<<" movie";

   }

int main()

{    

   

   display();

   return 0;

}

 

7 0
3 years ago
Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
Mandarinka [93]

Answer:

The answer to this question can be described as follows:

Explanation:

Relational data model:

The use of data tables to organize sets of entities into relationships requires a relational data model. this model work on the assumption, which is a primary key or code, that is included in each table configuration. The symbol for "relational" data links and information is used by other tables.

Model Design:

This model is used for database management, it consists of structure and language consistency. It is design in 1969.

Importance of data model:  

This provides a common standard for processing the potentially sound data in machines, that was usable on almost any one device.  

Big Data:

It moves to locate new and innovative ways to handle large volumes of authentication tokens and to gather business insights when offering high efficiency and usability at an affordable cost at the same time.

6 0
3 years ago
John is analyzing strange behavior on computers in his network. He believes there is malware on the machines. The symptoms inclu
enot [183]

Answer:

Boot Sector Virus

Explanation:

A malicious software or malware is an executable line of code, programmed by a cybercriminal for ill intentions. There are many types of malware namely; viruses, rootkit, keylogger, trojan horse etc.

A boot sector virus is a kind of malware that runs before the operating system, affecting the boot sector of the hard disk, so even when a linux live cd is running as the operating system, the virus is still active.

5 0
3 years ago
Other questions:
  • Which of the following is a full selector?
    12·1 answer
  • 5. The hazardous component in most antifreeze is _____, which is extremely toxic to humans and animals. A) Calcium Carbonate B)
    13·2 answers
  • Methods inherited from the base/super class can be overridden. This means changing their implementation; the original source cod
    5·1 answer
  • Television, radio, newspapers, magazines, the Internet, and other forms of communication are collectively referred to as thea. W
    15·1 answer
  • The concept/theory where computer generated animation (especially humans) that is TOO life-like they become uncomfortable to us
    15·2 answers
  • Www.microsoft.com is an example of this (two words) (last letter is e) and has to be (10 letters)
    10·1 answer
  • Dennis would like to include a video in a presentation. The source of the video is on the internet, but he would like to ensure
    10·2 answers
  • What are some preferences you can set in photoshop?
    5·1 answer
  • What refers to the processing of a substance or an object so that it may be used again?
    7·2 answers
  • To behave ethically means
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!