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 sports car has a weight of 4900 lblb and center of gravity at GG. If it starts from rest it causes the rear wheels to slip a
Zinaida [17]

Answer:

2.27secs

Explanation:

The car will take 2.27secs to reach a speed of 10 ft/s.

Kindly go through the attached files for a step by step solution that will show you how the answer was gotten and the normal reaction of both the front and rear wheels.

3 0
3 years ago
Problem: design the following rectangular floor beam for a building.
sammy [17]

Answer:

Area required = 9.5 ft²

Explanation:

Step by step explanation is given in the attached document.

8 0
3 years ago
Read 2 more answers
Roku internet service providet​
podryga [215]

Answer:

What?? I do not understand?

6 0
3 years ago
If the gear ratio is 3:5 does it increase torque or speed?
Bas_tet [7]

Answer:

yes it does

Explanation:

3 0
3 years ago
Read 2 more answers
The following two questions refer to the circuit below. Consider a non-ideal op amp where the output can saturate. The open loop
kotykmax [81]

Answer:

The most positive is value of Vs is 0.5mV

6 0
3 years ago
Other questions:
  • 1. What is the linear distance traveled in one revolution of a 9 in diameter wheel?
    14·1 answer
  • What is the reading of this 0-1" micrometer? Enter your
    9·1 answer
  • A load P is applied horizontally while the other end is fixed to a structure. A load P is applied horizontally while the other e
    6·1 answer
  • A seamless pipe 800mm diameter contains a fluid under a pressure of 2N/mm2. If the permissible tensile stress is 100N/mm2, find
    11·1 answer
  • An undeformed specimen of some alloy has an average grain diameter of 0.050 mm. You are asked to reduce its average grain diamet
    11·1 answer
  • The coefficient of performance of a reversible refrigeration cycle is always (a) greater than, (b) less than, (c) equal to the c
    12·1 answer
  • Which of the following activities could lead to injuries?
    6·1 answer
  • Which option identifies the most likely scaling factor in the above drawing of the Mercury capsule and booster unit? 1:1,000 1:1
    14·1 answer
  • Why must fire extinguishers be routinely maintained
    15·2 answers
  • A heating torch is usually referred to as what?<br><br> Stick<br> Flower<br> Rose-bud<br> Lighter
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!