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
RideAnS [48]
3 years ago
5

Suppose values is a sorted array of integers. Give pseudocode that describes how a new value can be inserted so that the resulti

ng array stays sorted.
Engineering
1 answer:
Novosadov [1.4K]3 years ago
7 0

Answer:

insert (array[] , value , currentsize , maxsize )

{

   if maxsize <=currentsize

  {

      return -1

  }

  index = currentsize-1

  while (i>=0 && array[index] > value)

  {

      array[index+1]=array[index]

      i=i-1

  }

 

  array[i+1]=value

  return 0

}

Explanation:

1: Check if array is already full, if it's full then no component may be inserted.

2: if array isn't full:

  • Check parts of the array ranging from last position of range towards initial range and determine position of that initial range that is smaller than the worth to be inserted.  
  • Right shift every component of the array once ranging from last position up to the position larger than the position at that smaller range was known.
  • assign new worth to the position that is next to the known position of initial smaller component.
You might be interested in
In some synchronizer applications, the clock frequency f is substituted for the parameter a in metastability MTBF calculations,
Contact [7]

Answer:

Please see the attached file for the complete answer.

Explanation:

Download pdf
4 0
3 years ago
Eutectic product in Fe-C system is called A. Pearlite B. Bainite C. Ledeburite D. Spheroidite
zimovet [89]

Answer:

Eutectic product in Fe-C system is called Ledeburite-C.

6 0
3 years ago
How to build a robot
Anuta_ua [19.1K]
Seriously? Ok

first, get some good quality metal, preferably aluminum, if you want to avoid rust.

build in the the shape of a robot, you can use a doll to help you if you are a beginner, but feel free to shape it the a Star Wars Character!

create an AI (now you said robot not AI) and fix everything up.
7 0
3 years ago
Consider a continuous-time LTI system whose frequency response is I x sin(4w) H(jw) = -x h(t)e-jwtdt = w If the input to this sy
Helga [31]

Answer:

I believe this is your question.

See the hand worked solution attached.

8 0
3 years ago
. Two rods, with masses MA and MB having a coefficient of restitution, e, move
GarryVolchara [31]

Answer:

a) V_A = \frac{(M_A - eM_B)U_A + M_BU_B(1+e)}{M_A + M_B}

V_B = \frac{M_AU_A(1+e) + (M_B - eM_A)U_B}{M_A + M_B}

b) U_A = 3.66 m/s

V_B = 4.32 m/s

c) Impulse = 0 kg m/s²

d) percent decrease in kinetic energy = 47.85%

Explanation:

Let U_A be the initial velocity of rod A

Let U_B be the initial velocity of rod B

Let V_A be the final velocity of rod A

Let V_B be the final velocity of rod B

Using the principle of conservation of momentum:

M_AU_A + M_BU_B = M_AV_A + M_BV_B............(1)

Coefficient of restitution, e = \frac{V_B - V_A}{U_A - U_B}

V_A = V_B - e(U_A - U_B)........................(2)

Substitute equation (2) into equation (1)

M_AU_A + M_BU_B = M_A(V_B - e(U_A - U_B)) + M_BV_B..............(3)

Solving for V_B in equation (3) above:

V_B = \frac{M_AU_A(1+e) + (M_B - eM_A)U_B}{M_A + M_B}....................(4)

From equation (2):

V_B = V_A + e(U_A -U_B)......(5)

Substitute equation (5) into (1)

M_AU_A + M_BU_B = M_AV_A + M_B(V_A + e(U_A -U_B))..........(6)

Solving for V_A in equation (6) above:

V_A = \frac{(M_A - eM_B)U_A + M_BU_B(1+e)}{M_A + M_B}.........(7)

b)

M_A = 2 kg\\M_B = 1 kg\\U_B = -3 m/s( negative x-axis)\\e = 0.65\\U_A = ?

Rod A is said to be at rest after the impact, V_A = 0 m/s

Substitute these parameters into equation (7)

0 = \frac{(2 - 0.65*1)U_A - (1*3)(1+0.65)}{2+1}\\U_A = 3.66 m/s

To calculate the final velocity, V_B, substitute the given parameters into (4):

V_B = \frac{(2*3.66)(1+0.65) - (1 - (0.65*2))*3}{2+1}\\V_B = 4.32 m/s

c) Impulse, I = M_AV_A + M_BV_B - (M_AU_A + M_BU_B)

I = (2*0) + (1*4.32) - ((2*3.66) + (1*-3))

I = 0 kg m/s^2

d) %\triangle KE = \frac{(0.5 M_A V_A^2 + 0.5 M_B V_B^2) - ( 0.5 M_A U_A^2 + 0.5 M_B U_B^2)}{0.5 M_A U_A^2 + 0.5 M_B U_B^2} * 100\%

%\triangle KE = \frac{((0.5*2*0) + (0.5 *1*4.32^2)) - ( (0.5 *2*3.66^2) + 0.5*1*(-3)^2))}{ (0.5 *2*3.66^2) + 0.5*1*(-3)^2)} * 100\%

% \triangle KE = -47.85 \%

7 0
3 years ago
Other questions:
  • The small washer is sliding down the cord OA. When it is at the midpoint, its speed is 28 m/s and its acceleration is 7 m/s 2 .
    13·1 answer
  • What happens when a larger force is applied?
    9·1 answer
  • A socket can be driven using any of the following except for (A) a socket ratchet
    14·1 answer
  • Which of the following refers to software designed to alter system files and utilities on a victim’s system with the intention o
    15·1 answer
  • You apply a force of 19 lbs on to the end of a lever to lift a crate. The resistance of the load is 106 lbs. Calculate the
    13·1 answer
  • What are the laws that apply to one vehicle towing another?
    11·1 answer
  • 25 In differential aeration corrosion, rich oxygenated parts are
    14·1 answer
  • Dear sir i want to ask something about the solution of my question?
    9·1 answer
  • If a material is found to be in the tertiary phase of creep, the following procedure should be implemented:
    8·1 answer
  • Which of the following is NOT an ASE certification? Select one:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!