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]
2 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]2 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
Another focus of effective communication, according to Stephen Covey, is ensuring that:
svetoff [14.1K]

Answer:

Stephen Covey believes this principle is the key to effective interpersonal communication. Seek first to understand, then to be understood. This habit is about communicating with others. It's about developing the habit of listening carefully and really understanding the other person BEFORE giving your thoughts.

Explanation:

4 0
3 years ago
Read 2 more answers
2. There are three drawings that architects and designers use to indicate spaces. What are these drawing?
Zarrin [17]

Answer:

Architectural plans.

Explanation:

An architectural plan is called the drawings made by architects, civil engineers or designers of spaces or interiors, in which these professionals capture their building projects, organizing the distribution of the spaces to be used, the elements to be located in them and, fundamentally, to give construction planning a projection into reality. Thus, the plans help professionals to have a better understanding of the expected end result of the projects they are carrying out.

3 0
3 years ago
What should always be done before beginning any diagnosis?
vladimir2022 [97]

Answer:

c

Explanation:

if someone is wrong that they can help with

4 0
2 years ago
1: asha started abusness with 30.000
svetoff [14.1K]

Answer:

Explanation:adrive with visual acutity of 20/30 can just decipher asing adistance 20ft from asing determine the maximum destance from the sing which drivers with the flowing visual acuities will able to see the same sing 20/15 20/50

4 0
2 years ago
A reservoir is 1 km wide and 10 km long and has an average depth of 100m. Every hour, 0.1% of the reservoir's volume drops throu
Ksju [112]

Answer:

250.7mw

Explanation:

Volume of the reservoir = lwh

Length of reservoir = 10km

Width of reservoir = 1km

Height = 100m

Volume = 10x10³x10³x100

= 10⁹m³

Next we find the volume flow rate

= 0.1/100x10⁹x1/3600

= 277.78m³/s

To get the electrical power output developed by the turbine with 92 percent efficiency

= 0.92x1000x9.81x277.78x100

= 250.7MW

7 0
3 years ago
Other questions:
  • Explain the two advantages and the two disadvantages of fission as an energy source.
    12·1 answer
  • Which sentence about the technology design process is true
    12·1 answer
  • A transmitter has an output power of 0.1mW while the fiber has coupling loss of 12dB, attenuation of
    11·1 answer
  • A logic chip used in a computer dissipates 3 W of power in an environment at 120°F, and has a heat transfer surface area of 0.08
    11·1 answer
  • A two-bus power system is interconnected by one transmission line. Bus 1 is a generator bus with specified terminal voltage magn
    6·1 answer
  • B) Calculate the FS against uplift and calculate effoctive stress at the base level for water
    11·1 answer
  • You are a planning aide on a team and are given the assignment of researching the historical significance and original blueprint
    5·1 answer
  • At a certain location, wind is blowing steadily at 7 m/s. Determine the mechanical energy of air per unit mass and the power gen
    14·1 answer
  • What is the width of a professional football field?.
    5·1 answer
  • Why is communication one of the most important aspects of an engineer's job?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!