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
____ grinders are used to grind diameters, shoulders, and faces much like the lathe is used for turning, facing, and boring oper
skelet666 [1.2K]

Answer:

Cylindrical

Explanation:

<em>A cylindrical grinder </em><em>is a tool for shaping the exterior of an item. Although cylindrical grinders may produce a wide range of forms, the item must have a central axis of rotation. Shapes such as cylinders, ellipses, cams, and crankshafts are examples of this.</em><em> Cylindrical grinding</em><em> machines are specialized grinding machines that are used to process cylinders, rods, and similar workpieces. The cylinders revolve in one direction between two centers, while the grinding wheel or wheels are close together and rotate in the other direction.</em>

8 0
2 years ago
Technician A says that proper footwear may include both leather and steel-toed shoes. Technician B says that leather-soled shoes
Amanda [17]

Given:

We have given two statements.

Statement 1: Proper footwear may include both leather and steel-toed shoes.

Statement 2:  Leather-soled shoes provide slip resistance.

Find:

Which statement is true.

Solution:

A slip-resistant outsole is smoother and more slip-resistant than other outsole formulations when exposed to water and oil. A smoother outsole in rubber ensures a slip-resistant shoe can handle a slippery floor more effectively.

Slip resistant shoes have an interlocked tread pattern that does not close the water in, enabling the slip resistant sole to touch the floor to provide better slip resistance.

Leather-soled shoes don't provide slop resistance.

Therefore, both the Technicians are wrong.

5 0
3 years ago
The inspector should inspect insulation in unfinished spaces, including attics, _____ and foundation areas.
RoseWind [281]

Answer:

basements

Explanation:

6 0
2 years ago
Pedro holds a heavy science book over his head for 10 minutes. Petro is doing work during that time. True or False
algol [13]

Answer:

True because he is working his arms to lift and hold the weight

Explanation:

4 0
3 years ago
A river has an average rate of water flow of 59.6 M3/s. This river has three tributaries, tributary A, B and C, which account fo
Fiesta28 [93]

Answer:

50421.6 m³

Explanation:

The river has an average rate of water flow of 59.6 m³/s.

Tributary B accounts for 47% of the rate of water flow. Therefore the rate of water flow through tributary B is:

Flow rate of water through tributary B = 47% of 59.6 m³/s = 0.47 * 59.6 m³/s = 28.012 m³/s

The volume of water that has been discharged through tributary B = Flow rate of water through tributary B * time taken

time = 30 minutes = 30 minutes * 60 seconds / minute = 1800 seconds

The volume of water that has been discharged through tributary B in 30 seconds = 28.012 m³/s * 1800 seconds = 50421.6 m³

3 0
3 years ago
Other questions:
  • Can the United States defeat Iranian forces
    9·2 answers
  • Calculate the value of ni for gallium arsenide (GaAs) at T = 300 K. The constant B = 3. 56 times 1014 9cm -3 K-3/2) and the band
    9·1 answer
  • Someone please help me with this I’m stuck on it ?!i don’t have a lot of time
    12·1 answer
  • A combinational switching circuit has four inputs (A, B, C, D) and one output (F).
    9·1 answer
  • Turn the motor around in the circuit. What happens?
    12·1 answer
  • Two engineers are discussing the various merits of hydroelectricity. Engineer A says that tidal barrage systems can generate ele
    6·1 answer
  • Please help is due tonight
    6·2 answers
  • Which is an alloy made up of iron and carbon and has high compressive and tensile strength?
    11·1 answer
  • What is the measurment unit of permeability?​
    7·2 answers
  • The web page you created displays the time in the correct time zone for the user's location.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!