subject
Engineering, 23.03.2020 19:24 Kiaraboyd9366

Can you explain what the pseudo-code below is trying to do? array[N] # array of N integers, indexed 0 to N-1; #assume it's populated with (1,4,2,-2,-9,10,2,12,2,-4,-4,-4,-4, 2,6,7] peak = array[0] index = 0 output = [] # array of tuples For x in 1..N-1 if (array[x]*array[x-1) > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x else output. insert( (index, peak)) peak = array[x] index = x end if end for return output

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:20
Acertain flow of air (at stp) has a velocity distribution given by v i (in ft/s). if this flow is going through a 4 ft square area in the yz-plane (centered at the origin), what is the mass flow rate (in lbm/s)?
Answers: 2
question
Engineering, 04.07.2019 18:20
Asimple rankine cycle uses water as the working fluid. the water enters the turbine at 10 mpa and 480c while the condenser operates at 6 kpa. if the turbine has an isentropic efficiency of 80 percent while the pump has an isentropic efficiency of 70 percent determine the thermal efficiency
Answers: 1
question
Engineering, 04.07.2019 18:20
Amixture of slurry and mud is to be pumped through a horizontal pipe of diameter 500 mm. the fluid behaves as a bingham plastic with a yield stress of 30 pa and viscosity 0.04 pa.s. describe the effects of the shear stress through a transverse section of the pipe by plotting the variation in shear stress and velocity profile: (i) just before the slurry starts to move (ii) as the slurry flows when the pressure gradient is double that in part (i)
Answers: 3
You know the right answer?
Can you explain what the pseudo-code below is trying to do? array[N] # array of N integers, indexed...
Questions
question
Mathematics, 07.04.2021 19:10
question
Mathematics, 07.04.2021 19:10
question
Mathematics, 07.04.2021 19:10
question
Social Studies, 07.04.2021 19:10
question
Computers and Technology, 07.04.2021 19:10
question
Mathematics, 07.04.2021 19:10
question
English, 07.04.2021 19:10
Questions on the website: 13722361