Question: Write a static function in Java taking an array of doubles and returning an int. Your function should return the number zero-crossings, that is, the
Write a static function in Java taking an array of doubles and returning an int. Your function should return the number "zero-crossings", that is, the number of times the consecutive values in the array go from strictly negative to strictly positive or from strictly positive to strictly negative. For example, if the array holds {-1.0, 1.0, -1.0, -0.9} the number of zero-crossings is 2, one between elements 0 and 1, and one between 1 and 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
