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
AlekseyPX
4 years ago
13

You need to sort a file of n GB file stored on a hard-drive. Your RAM contains only 5GB. You have a lightning-fast CPU, but writ

ing or reading from the disk (a single I/O operation) is slow. So we estimate the number of I/O, and ignore CPU time. For simplicity, assume your disk is partition into blocks, each of size 1GB. In each I/O operation, you could read or write one block. The input file occupies the blocks b_1 ellipsis b_n. Explain how to sort the file, using O(nlogn) I/O operations. You could assume that your hard-drive contains n blocks of free space f_1, f_2, ellipsis, f_n Ignore caching issues.
Engineering
1 answer:
ale4655 [162]4 years ago
8 0

Answer:

It is given that:

  • There are "n" GB data need to be sorted.
  • The data is divided into blocks "n" blocks each of 1 GB.
  • Thus data need to be sorted based on the block contents.
  • There are n" blocks each of 1 GB is free on the hard-disk.

Steps to follow to perform the sorting of the data stored In the hard-drive:

  • Divide the blocks to be sorted into set of five blocks, here divide the blocks into n/2
  • sets.
  • 5 GB RAM can access the data fast and perform the sort of the each 2 block sets.
  • Now each of the 2 block sets are sorted based on the block number.
  • Take adjacent two sorted individual 2-blocks from the hard disk and perform the sort operation on the combined block and make them sorted.
  • Continue the merging of individually sorted blocks from 2, 4, 8, 16.  n/2.
  • After "log n " merge operations the blocks will be sorted.

Explanation of complexity of the procedure:

  • The data is divided into chunks of 5 block sets.
  • Each set need to be sorted individually, and 5 GB ram can handle the sorting or each two blocks, thus it will take 2 I/O operations in each block sort.
  • There are "n/2" blocks will be there with 2 I/0 operations each collectively it will take n I/O operations.
  • The merging of the sorted blocks will take "log_{2}n" operations.
  • The comparison and copying operation may have to be performed at each merging stage.
  • Thus total I/O operation required will be "n*logn".

You might be interested in
A cylindrical specimen of cold-worked steel has a Brinell hardness of 250.(a) Estimate its ductility in percent elongation.(b) I
koban [17]

Answer:

A) Ductility = 11% EL

B) Radius after deformation = 4.27 mm

Explanation:

A) From equations in steel test,

Tensile Strength (Ts) = 3.45 x HB

Where HB is brinell hardness;

Thus, Ts = 3.45 x 250 = 862MPa

From image 1 attached below, for steel at Tensile strength of 862 MPa, %CW = 27%.

Also, from image 2,at CW of 27%,

Ductility is approximately, 11% EL

B) Now we know that formula for %CW is;

%CW = (Ao - Ad)/(Ao)

Where Ao is area with initial radius and Ad is area deformation.

Thus;

%CW = [[π(ro)² - π(rd)²] /π(ro)²] x 100

%CW = [1 - (rd)²/(ro)²]

1 - (%CW/100) = (rd)²/(ro)²

So;

(rd)²[1 - (%CW/100)] = (ro)²

So putting the values as gotten initially ;

(ro)² = 5²([1 - (27/100)]

(ro)² = 25 - 6.75

(ro) ² = 18.25

ro = √18.25

So ro = 4.27 mm

6 0
4 years ago
If you know that the change in entropy of a cup of coffee where heat was added is 20 J/K, and that the temperature of the coffee
Anna35 [415]

Answer:

5000J

Explanation:

Given in the question that

Heat added to the coffee cup is, ΔS = 20 J/K

The temperature of the coffee, T = 250 K

Now, using the formula for the entropy change

\bigtriangleup S=-\frac{\bigtriangleup H}{T} ...........(1)

Where,

ΔS is the entropy change

ΔH is the enthalpy change

T is the temperature of the system

substituting the values in the equation (1)

we get

20=-\frac{\bigtriangleup H}{250}

ΔH=250×20

ΔH=5000 J

6 0
3 years ago
Design complementary static CMOS circuits with minimized number of transistors to realize the following Boolean functions (hint:
Pie

Answer:

as pull up network. the metteing point of pull down and pull up is the point where we take the output

note 1: if two n-mos are connected in series it gives logical AND and p-mos paralle gives logical-AND

note 2: if two n-mos are connected in parallel it gives logical OR and p-mos series gives logical-OR

note 3: output is always complement of what we implement

example Y= (AB)'

image attached

A) F = (ABC + D(A+B) )'

pulldown:

this can be realize by takeing three n-mos in series which gives ABC ,two n-mos are parallel which in series with another n-mos whic gives D(A+B), now connect ABC and D(A+B) in parallel

pull up

this can be realize by takeing three p-mos in parallel which gives ABC ,two p-mos are series which is in serires with

another p-mos whic gives D(A+B), now connect ABC and D(A+B) in series

the out put will be (ABC + D(A+B) )'

so we require total 6-mos and 6-pmos total 12mos transistors

B) F = AC + BD

pull down

this can be realize by takeing two n-mos in series which gives AB ,two n-mos are in series

which whic gives BD, now connect AC and BD in parallel

pull up

this can be realize by takeing two p-mos in parallel which gives Ac ,two p-mos are in parallel

which whic gives BD, now connect AC and BD in series

the output is (AC+BD)'

to avoid the complement we have to connect the output to c-mos inverter then we get AC+BD

so we require 5-nmos, 5-pmos total 10 mos transistors

8 0
3 years ago
How much work is performed if a 400 lb weight is lifted 10 ft ?
Setler [38]

W = M*G*H

Work done = 400*10

w = 4000 ft.lb

hope it helps!

7 0
4 years ago
Two heat exchangers are under consideration for purchase. A standard type of heat exchanger (code name HX1) has an initial insta
Leviafan [203]

Answer:

The lower capitalized cost is associated with HX1

Explanation:

The capitalized cost is basically the present cost. Therefore, for the Heat Exchanger HX1, the capitalized cost will be:

CC1 = First Cost

<u>CC1 = - $ 20,000</u>

Negative sign shows cash outflow.

Now, for Heat Exchanger HX2, we have:

CC2 = - $ 34,000 + ($ 4,000)(P/F, 6%, 10)

Now, we use the factor tables to calculate the present worth (P) of the salvage value, which is actually future worth, after 10 years at a compounded interest of 6% per year.

The factor table is provided in picture, with the value indicated.

CC2 = - $ 34,000 + ($ 4,000)(0.5584)

CC2 = - $ 34,000 + $ 2,233.6

<u>CC2 = - $ 31,766.4</u>

From the capitalized cost, taking look at the absolute values of both heat exchangers we can conclude that:

<u>The Heat Exchanger that will result in lower capitalized cost is HX1</u>

3 0
3 years ago
Other questions:
  • A square aluminum plate 5 mm thick and 200 mm on a side is heated while vertically suspended in quiescent air at 40C. (A) Determ
    8·1 answer
  • Briefly explain what are the following AIDC technologies for industry automation:
    11·1 answer
  • A 3-oz serving of roasted, skinless chicken breast contains 140 Cal, 27 g of protein, 3 g of fat, 13 mg of calcium, and 64 mg of
    7·1 answer
  • During the era of known as the Stone Age, no tools were used and no technology was created.
    15·1 answer
  • If you owned a business, what are some of the ways you could follow green computing recommendations with regards to recycling an
    13·1 answer
  • NEED HELP PLEASE
    15·1 answer
  • Think for a moment about the potential problems with big data that the speaker mentioned:
    11·2 answers
  • HELP PLS<br> Is a book a solid, frame, shell or combination and WHY
    6·2 answers
  • Since 1990, hand-held mobile phones have been used as communication devices. Mobile phones have gone through a lot of design cha
    13·1 answer
  • Which of the following is defined as the progression of Ideas leading to the final delivery of a product?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!