subject
Engineering, 02.03.2020 22:54 yokis2710

Int n1 = q - p + 1; // size of left array

int n2 = r - q; // size of right array

int L[] = new int[n1 + 1];// left array

int R[] = new int[n2 + 1]; //right array

for (int i = 0; i < n1; i++) // going through the first half

{

L[i] = a[p + i];

}

for (int j = 0; j < n2; j++) // going through the second half

{

R[j] = a[q + j + 1];

}

L[n1] = Integer. MAX_VALUE; //sentinel value

R[n2] = Integer. MAX_VALUE;

int i = 0;

int j = 0;

int k = p;

while(i
{

count++;

if (L[i] <= R[j])

{

a[k] = L[i];

i = i + 1;

}

else

{

a[k] = R[j];

j = j + 1;

}

k++;

}

while (i < n1)

{

a[k] = L[i];

i++;

k++;

}

while (j < n2)

{

a[k] = R[j];

j++;

k++;

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
question
Engineering, 04.07.2019 18:20
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
question
Engineering, 04.07.2019 18:20
A2-m rigid tank initially contains saturated water vapor at 100 kpa. the tank is connected to a supply line through a valve. steam is flowing in the supply line at 600 kpa and 300 c. the valve is opened, and steam is allowed to enter the tank until the pressure in the tank reaches the line pressure, at which point the valve is closed. a thermometer placed in the tank indicates that the temperature at the final state is 200°c. determine (a) the mass of steam that has entered the tank (b) the amount of heat transfer.
Answers: 3
You know the right answer?
Int n1 = q - p + 1; // size of left array

int n2 = r - q; // size of right array
Questions
question
Mathematics, 07.10.2019 01:30
question
Mathematics, 07.10.2019 01:30
Questions on the website: 13722367