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
A rectangular open box, 25 ft by 10 ft in plan and 12 ft deep weighs 40 tons. Sufficient amount of stones is placed in the box a
dimulka [17.4K]

Answer:

44.95 tonnes

Explanation:

According to principle of buoyancy the object will just sink when it's weight is more than the weight of the liquid it displaces

It is given that empty weight of box = 40 tons

Let the mass of the stones to be placed be = M tonnes

Thus the combined mass of box and stones = (40+M) tonnes..........(i)

Since the box will displace water equal to it's volume V we have volume of box = 25ft*10ft*12ft= 3000ft^{3}

Volume= 84.95m^{3}

Since 1ft^{3} =0.028m^{3}

Now the weight of water displaced = Weight =\rho \times Volumewhererho is density of water = 1000kg/m^{3}

Thus weight of liquid displaced = \frac{84.95X1000}{1000}tonnes=84.95 tonnes..................(ii)

Equating i and ii we get

40 + M = 84.95

thus Mass of stones = 44.95 tonnes

3 0
3 years ago
What is ONE DIFFERENCE between civil structural engineering
Rudiy27

Answer:

One of the differences is that civil engineering focuses on design elements while structural engineering is more concern on inspecting the materials used for construction. The structural engineers are the one who are supposed to ensure that the materials used for construction can support the design of the structure.

Explanation:

3 0
3 years ago
Superheated water vapor at a pressure of 20 MPa, a temperature of 500oC, and a flow rate of 10 kg/s is to be brought to a satura
katrin2010 [14]

Answer:

1.96 kg/s.

Explanation:

So, we are given the following data or parameters or information which we are going to use in solving this question effectively and these data are;

=> Superheated water vapor at a pressure = 20 MPa,

=> temperature = 500°C,

=> " flow rate of 10 kg/s is to be brought to a saturated vapor state at 10 MPa in an open feedwater heater."

=> "mixing this stream with a stream of liquid water at 20°C and 10 MPa."

K1 = 3241.18, k2 = 93.28 and 2725.47.

Therefore, m1 + m2= m3.

10(3241.18) + m2 (93.28) = (10 + m3) 2725.47.

=> 1.96 kg/s.

7 0
3 years ago
Các đặc điểm chính của đường dây dài siêu cao áp .
rodikova [14]

Answer:

Đường dây siêu cao áp 500kV: Những chuyện giờ mới kể ... ​Ngày 27/5/1994, hệ thống đường dây điện siêu cao áp 500kV Bắc - Nam chính thức đưa ... Tại thời điểm đó, các nước như Pháp, Úc, Mỹ khi xây dựng đường dây dài nhất ... và chế ra các máy kéo dây theo đặc thù công việc của từng đơn vị.

Explanation:

8 0
3 years ago
A thick oak wall initially at 25°C is suddenly exposed to gases for which T =800°C and h =20 W/m2.K. Answer the following questi
Schach [20]

Answer:

a) What is the surface temperature, in °C, after 400 s?

   T (0,400 sec) = 800°C

b) Yes, the surface temperature is greater than the ignition temperature of oak (400°C) after 400 s

c) What is the temperature, in °C, 1 mm from the surface after 400 s?

   T (1 mm, 400 sec) = 798.35°C

Explanation:

oak initial Temperature = 25°C = 298 K

oak exposed to gas of temp = 800°C = 1073 K

h = 20 W/m².K

From the book, Oak properties are e=545kg/m³   k=0.19w/m.k   Cp=2385J/kg.k

Assume: Volume = 1 m³, and from energy balance the heat transfer is an unsteady state.

From energy balance: \frac{T - T_{\infty}}{T_i - T_{\infty}} = Exp (\frac{-hA}{evCp})t

Initial temperature wall = T_i

Surface temperature = T

Gas exposed temperature = T_{\infty}

6 0
3 years ago
Other questions:
  • Members of the student council have been asked by their
    5·1 answer
  • What does WCS stand for? A. Western CAD System B. Worldwide Coordinate Sectors C. World Coordinate System D. Wrong CAD Settings
    10·1 answer
  • In the ______ phase of the organizational life cycle, the organization is usually very small and agile, focusing on new products
    8·1 answer
  • Arc blow typically occurs in steel and metals that contain iron.<br> True or false
    7·2 answers
  • Your friend has two substances A and B which are compressed liquid and superheated vapor respectively. Both are in rigid vessels
    15·1 answer
  • The image shows the relative positions of Earth and the Sun for each of the four seasons. Earth travels in an elliptical orbit a
    11·2 answers
  • Porque el invento de la bombilla es importante?
    6·1 answer
  • What’s the answer???
    9·1 answer
  • Why do engineers play a variety of roles in the engineering process?
    6·1 answer
  • The only way to know if a design will work in real-world conditions is to build a model, or prototype, based on the plan. This i
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!