Domanda di colloquio di Bloomberg

How would you find the largest value in an array?

Risposte di colloquio

Anonimo

17 feb 2010

Pramod's answer is almost perfect. I would make one change: assign temp the first value of the array.

1

Anonimo

24 mar 2011

is this a joke?

Anonimo

6 gen 2010

You will have to use a temp variable. Assign temp to -999 (assuming there is no negative 999 in the data set or use ascii for this. I am not familiar with ascii conversions). Go through the array comparing each variable with the temp. If array variable is higher, store it into temp. Keep doing this till you reach the end. Your temp has the largest value now.