Question: Write a static function called Normalized that takes a two-dimensional (2D) array of integer elements and returns normalized 2D array of elements of type

Write a static function called "Normalized" that takes a two-dimensional (2D) array of integer elements and returns normalized 2D array of elements of type double. For normalizing, the method should divide each input element with its row average (i.e., mean). For example, if a row is {1, 2, 3} then mean is (1+2+3)/3 = 2.0, and the row in result array should be (1/2.0, 2/2.0, 3/2.0) i.e., {0.5, 1.0, 1.5}. Here is the full example of 2D array: normalize(new int[][]{{1,2,3), (3,4,5}}) should return {{0.5, 1.0, 1.5}, {0.75, 1.0, 1.25}}. For the row (3,4,5), mean is (3+4+5)/3 = 4.0, thus the values after normalizing would be {0.75, 1.0, 1.25).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
