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
The uniform crate has a mass of 50 kg and rests on the cart having an inclined surface. Determine the smallest acceleration that
Lostsunrise [7]

Answer: smallest will be 000,.111 84.

Explanation:

5 0
4 years ago
Does anyone know what this is​
sammy [17]

Answer:

Looks like mold that got frosted over

Explanation:

4 0
2 years ago
Read 2 more answers
. Using the Newton Raphson method, determine the uniform flow depth in a trapezoidal channel with a bottom width of 3.0 m and si
Over [174]

Answer:

y  ≈ 2.5

Explanation:

Given data:

bottom width is 3 m

side slope is 1:2

discharge is 10 m^3/s

slope is 0.004

manning roughness coefficient is 0.015

manning equation is written as

v =1/n R^{2/3} s^{1/2}

where R is hydraulic radius

S = bed slope

Q = Av =A 1/n R^{2/3} s^{1/2}

A = 1/2 \times (B+B+4y) \times y =(B+2y) y

R =\frac{A}{P}

P is perimeter =  (B+2\sqrt{5} y)

R =\frac{(3+2y) y}{(3+2\sqrt{5} y)}

Q = (2+2y) y) \times 1/0.015 [\frac{(3+2y) y}{(3+2\sqrt{5} y)}]^{2/3} 0.004^{1/2}

solving for y100 =(2+2y) y) \times (1/0.015) [\frac{(3+2y) y}{(3+2\sqrt{5} y)}]^{2/3} \times 0.004^{1/2}

solving for y value by using iteration method ,we get

y  ≈ 2.5

5 0
3 years ago
A house is losing heat at a rate of 1700 kJ/h per °C temperature difference between the indoor and the outdoor temperatures. Exp
Furkat [3]

Answer:

1700kJ/h.K

944.4kJ/h.R

944.4kJ/h.°F

Explanation:

Conversions for different temperature units are below:

1K = 1°C + 273K

1R = T(K) * 1.8

= (1°C + 273) * 1.8

1°F = (1°C * 1.8) + 32

Q/delta T = 1700kJ/h.°C

T (K) = 1700kJ/h.°C

= 1700kJ/K

T (R) = 1700kJ/h.°C

= 1700kJ/h.°C * 1°C/1.8R

= 944.4kJ/h.R

T (°F) = 1700kJ/h.°C

= 1700kJ/h.°C * 1°C/1.8°F

= 944.4kJ/h.°F

Note that arithmetic operations like subtraction and addition of values do not change or affect the value of a change in temperature (delta T) hence, the arithmetic operations are not reflected in the conversion. Illustration: 5°C - 3°C

= 2°C

(273+5) - (273+3)

= 2 K

5 0
4 years ago
The two boxcars A and B have a weight of 20 000 Ib and 30 000 Ib, respectively. If they coast freely down the incline when the b
Tpy6a [65]

Answer:

Answer for the question :

"the two boxcars A and B have a weight of 20 000 Ib and 30 000 Ib, respectively. If they coast freely down the incline when the brakes are applied to all the wheels of car A causing it to skid, determine the force in the coupling C between the two cars. The coefficient of kinetic friction between the wheels of A and the tracks is μk=0.5. The wheels of car B are free to roll. Neglect their mass in calculation."

is explained in the attachment.

Explanation:

Download pdf
3 0
3 years ago
Read 2 more answers
Other questions:
  • A petrol engine produces 20 hp using 35 kW of heat transfer from burning fuel. What is its thermal efficiency, and how much powe
    14·1 answer
  • g A 30-m-diameter sedimentation basin has an average water depth of 3.0 m. It is treating 0.3 m3/s wastewater flow. Compute over
    8·1 answer
  • How much work is performed if a 400 lb weight is lifted 10 ft ?
    8·1 answer
  • You have designed a bone plate that is manufactured via rolling under cold working conditions, and tests show good biocompatibil
    14·1 answer
  • A non-linear analog force sensor outputs the following voltages for different forces.
    7·1 answer
  • A. Derive linear density expressions for BCC [110] and [111] directions in terms of the atomic radius R.
    7·1 answer
  • A railroad runs form city A to city B, a distance of 800km, through mountainous terrain. The present one-way travel time (includ
    13·1 answer
  • list out main types of material used in design and Manufacture of product give one example for each in engineering application ?
    10·1 answer
  • There are some sections of the SDS that are not mandatory.
    11·1 answer
  • 2. How were scientists able to access a car's computer system?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!