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
Sedbober [7]
4 years ago
15

Assuming that a query has a buffer holding up to 3 blocks, and each block can hold two records. Use merge-sort to sort the follo

wing records in ascending order: 10, 11, 1, 5, 90, 1, 2, 101
How many runs will be produced in the whole algorithm and what are the contents of the runs?
Engineering
1 answer:
kipiarov [429]4 years ago
5 0

Answer:

a) 5 runs will be generated.

b) Since the buffer can hold 3 records, the first 3 runs are (1, 10, 11), (1, 5, 90) and (2, 10). Then we need to reserve one block as output buffer, the algorithm can merge two runs at most at the same time. As a result, we can choose to merge the first two runs into a larger one: (1,1,5,10,11,90), which is merged with the run (2, 10) to generate the final output.

Explanation:

5 runs will be generated.

Since the buffer can hold 3 records, the first 3 runs are (1, 10, 11), (1, 5, 90) and (2, 10). Then we need to reserve one block as output buffer, the algorithm can merge two runs at most at the same time. As a result, we can choose to merge the first two runs into a larger one: (1,1,5,10,11,90), which is merged with the run (2, 10) to generate the final output.

You might be interested in
declare integer product declare integer number product = 0 do while product < 100 display ""Type your number"" input number p
Brilliant_brown [7]

Full Question

1. Correct the following code and

2. Convert the do while loop the following code to a while loop

declare integer product

declare integer number

product = 0

do while product < 100

display ""Type your number""

input number

product = number * 10

loop

display product

End While

Answer:

1. Code Correction

The errors in the code segment are:

a. The use of do while on line 4

You either use do or while product < 100

b. The use of double "" as open and end quotes for the string literal on line 5

c. The use of "loop" statement on line 7

The correction of the code segment is as follows:

declare integer product

declare integer number

product = 0

while product < 100

display "Type your number"

input number

product = number * 10

display product

End While

2. The same code segment using a do-while statement

declare integer product

declare integer number

product = 0

Do

display "Type your number"

input number

product = number * 10

display product

while product < 100

4 0
4 years ago
What are the rigging devices used to move loads such as steel plates and sheet piles without the use of slings, but grip the loa
scoundrel [369]

The rigging device which are used to move loads without the use of slings, but grip the load by biting down and using jaw tension to secure the load, is lifting clamps.

<h3>What are the rigging devices?</h3>

The rigging devices are used to lift the objects and items when the safety is required. This device is used in the industries.

Types of rigging devices

  • Rigging hooks-These rigging device is used when the heavy load need to be lift.
  • Lifting clamps-Lifting clamp are used to lift the device with jaw tension to secure the load. In this, there is no use of slings.
  • Pulley and blocks-In the load is lifts with the help of block and pulley arrangement. This is a widely used rigging device.

Thus, the rigging device which are used to move loads without the use of slings, but grip the load by biting down and using jaw tension to secure the load, is lifting clamps.

Learn more about the rigging devices here;

brainly.com/question/8430576

#SPJ1

4 0
3 years ago
An inductor of ????=6.95 H with negligible resistance is placed in series with a ℰ=12.5 V battery, a ????=3.00 Ω resistor, and a
elena-14-01-66 [18.8K]

Answer:

a) I=0 b) 4.17V c) 0.354 A d) 14.5s

Explanation:

a) consider circuit in the attachment

i(t)= E/R (1- e^(-t/RL))

i(0)= 12.5/3×(1-e^(0/RL))

i(0)=0

b) at t⇒∞

i(∞)= 12.5/3× (1- e^(-∞/RL))

    = 4.17V

c) 1/RL= 1/(6.95×3)= 0.0479616

i(1.85) = 12.5/3 × (1- e^(-1.85×0.0479616)

         = 0.354A

d) I/2= I (1- e^(-t/RL))

t= - RL ln0.5

t= - 3×6.95 × (-0.693)

t= 14.5 s

8 0
4 years ago
This method will sell the seat in row i and column j unless it is already sold. A ticket is sold if the price of that seat in th
blsea [12.9K]

Answer:

The solution code is written in Java.

  1. public class Movie {
  2.    private double  [][] seats = new double[5][5];
  3.    private double totalSales;
  4.    public Movie(){
  5.        for(int i= 0; i < this.seats.length; i++){
  6.            for(int j = 0; j < this.seats[i].length; j++){
  7.                this.seats[i][j] = 12;
  8.            }
  9.        }
  10.        this.totalSales = 0;
  11.    }
  12.    public boolean bookSeat(int i, int j)
  13.    {
  14.        if(this.seats[i][j] != 0){
  15.            this.totalSales += this.seats[i][j];
  16.            this.seats[i][j] = 0;
  17.            return true;
  18.        }else{
  19.            return false;
  20.        }
  21.    }
  22. }

Explanation:

The method, bookSeat(), as required by the question is presented from Line 16 - 26 as part of the public method in a class <em>Movie</em>.  This method take row,<em> i</em>, and column,<em> j</em>, as input.

By presuming the seats is an two-dimensional array with all its elements are  initialized 12 (Line 7 - 10). This means we presume the movie ticket price for all the seats are $12, for simplicity.

When the<em> bookSeat() </em>method is invoked, it will check if the current price of seats at row-i and column-i is 0. If not, the current price, will be added to the <em>totalSales </em>(Line 19)<em> </em>and then set the price to 0 (Line 20) and return <em>true</em> since the ticket is successfully sold (Line 21).  If it has already been sold, return <em>false</em> (Line 23).

8 0
3 years ago
Which - type of service shop is least likely to provide service to all
MatroZZZ [7]
E. None of the above
8 0
3 years ago
Other questions:
  • Technician A says that applying too much braking force can cause tires to lose traction. Technician B says that ABS systems have
    7·1 answer
  • Compare a series circuit powered by six 1.5-volt batteries to a series circuit powered by a single 9-volt battery. Make sure the
    6·1 answer
  • An FCC iron–carbon alloy initially containing 0.35 wt% C is exposed to an oxygen-rich and virtually carbon-free atmosphere at 14
    11·1 answer
  • Why was the lack of preparedness of the Federal Emergency Management Agency in the Hurricane Katrina disaster so damaging for th
    12·1 answer
  • Given the strings s1 and s2, not necessarily of the same length, create a new string consisting of alternating characters of s1
    5·1 answer
  • Which of these is NOT a function of Shock Absorbers?
    15·2 answers
  • (The subject is Drivers Ed but they Cleary don't have it)
    14·1 answer
  • How much will it cost to train the entire company to use a recycling program if the training includes paper handouts? (Remember,
    12·1 answer
  • If an improvement creates no significant change in a product’s performance, then it is a(n) design improvement.
    11·2 answers
  • How is electricity made from fossil fuels such as coal?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!