3. Write a method normaliseArray which takes a single argument arr of type int[]; returns an array of the same size,
Posted: Mon May 02, 2022 12:19 pm
3. Write a method normaliseArray which
takes a single argument arr of type int[];
returns an array of the same size, but of type double[].
The values in the return array are computed by scanning arr to
find the
largest absolute value m, and loading position i of the return
array with the
result of dividing the value at position i of arr by m.
You can assume that arr does not contain any negative values.
Array arr must
not be altered.
Java language
takes a single argument arr of type int[];
returns an array of the same size, but of type double[].
The values in the return array are computed by scanning arr to
find the
largest absolute value m, and loading position i of the return
array with the
result of dividing the value at position i of arr by m.
You can assume that arr does not contain any negative values.
Array arr must
not be altered.
Java language