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, 03.07.2019 15:10
Ahouse has the following electrical appliance usage (1) single 40w lamp used for 4 hours per day (2) single 60w fan used for 12 hours per day (3) single 200w refrigerator that runs 24 hours per day with compressor run 12 hours and off 12 hours find the solar power inverter size in watt with correction factor of 1.25.
Answers: 1
question
Engineering, 04.07.2019 18:10
Apipe with an outside diameter of 15 cm is exposed to an ambient air and surrounding temperature of -20°c. the pipe has an outer surface temperature of 65°c and an emissivity of 0.85. if the rate of heat loss from the pipe surface is 0.95 kw per meter of length, the external convective heat transfer coefficient (h) is: (a) 12.5 w/m"k (b) 18.6 w/mk (c) 23.7 w/mk (d) 27.9 w/mk (e) 33.5 w/mk
Answers: 1
question
Engineering, 04.07.2019 18:10
An ideal otto cycle with air as the working fluid has a compression ratio of 8. the minimum and maximum temperatures in the cycle are 300 k and 1340 k. use constant specific heats at room temperature to determine (a) the amount of heat transferred to the air during the heat- addition kj/kg, (b) the thermal efficiency, and (c) the thermal efficiency of a carnot cycle ope limits. process, in rating between the same temperature
Answers: 2
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
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, 21.02.2020 17:59
question
Mathematics, 21.02.2020 17:59
question
Mathematics, 21.02.2020 17:59
question
Mathematics, 21.02.2020 17:59
Questions on the website: 13722367