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 18:10
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:20
Athin walled concentric tube exchanger is used to cool engine oil from 160°c to 60°c with water that is available at 25°c acting as a coolant. the oil and water flow rates are each at 2 kg/s, and the diameter of the inner tube is 0.5 m and the corresponding value of the overall heat transfer coefficient is 250 w/m2. oc. how long must the heat exchanger be to accomplish the desired cooling? cpwater=4.187 kj/kg-candcpengine el=2.035 kj/kg·°c, oil . 120]
Answers: 1
question
Engineering, 04.07.2019 18:20
What is the heat treatment of metals? what is the benefit of it? why and how it's useful? answer in details, do not write by hand.
Answers: 3
question
Engineering, 04.07.2019 18:20
The characteristic roots of a dynamic system are: 1.7920 1.8160 i, -1.7920 1.8160 i, -0.4160 what is the order of this system? what are the settling time and damping ratio of the system?
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, 05.12.2020 02:30
question
Mathematics, 05.12.2020 02:30
question
Mathematics, 05.12.2020 02:30
Questions on the website: 13722363