[solved]-Values Locations Peaks Plateaus Data Usually Much Important Simply Knowing Many Peaks Pro Q39025457
The values and locations of the peaks (and plateaus) in data areusually much more important than simply knowing how many peaksthere are. In this problem, you will find the values and locationsof all the peaks. Create a class called FindPeaks with the singlestatic method
![2 Peak Analysis II [30 marks] The values and locations of the peaks (and plateaus) in data is usually much more important tha](https://media.cheggcdn.com/media/9a5/s777x498/9a51d6ba-6481-4a82-b80d-184c66a4c503/phpPfvWnE.png)
public class Plateaus{
/** Finds the number of “plateaus” in the input dataarray.
* <p>
* Examples:
* int[] data1 = {1,3,3,1,5,5,5,2,10,6};
* numberOfPlateaus(data1) ==> 2 ( 3,3 and 5,5,5 areplateaus)
* int[] data2 = {4,3,6};
* numberOfPlateaus(data2) ==> 0 (there are noplateaus)
* int[] data3 = {2,2};
* numberOfPlateaus(data3) ==> 1 ( 2,2 is aplateau)
* @param data is an array of one or moreintegers.
*
* @return the number of “plateaus” in the input dataarray.
*/
public static int numberOfPlateaus(int[] data){
return -7;
}
}
2 Peak Analysis II [30 marks] The values and locations of the peaks (and plateaus) in data is usually much more important than simply knowing how many peaks there are. In this problem you will find the values and locations of all the peaks. Create a class called FindPeaks with the single static method public static int[ findPeaks (int[] data) The method returns a 2-dimensional array of integers that correspond to the values and locations (in the data array) of all the peaks. The order of the peaks in the output array should correspond to the order of the peaks in the data. For example, the first peak in the input data will be the first peak in the output array. Consider the following code: int[] data = {3,6,7,5,3,-1,1}; int[] [] peaks = FindPeaks. findPeaks (data); // array from problem 1 The peaks variable, after calling findPeaks (data), will be equivalent to the following array int (1) answer = { {7, 1}, {2, 6} }; 1/ peak values 1/ peak locations Here peaks [O] [O] is the value of the first peak which is located at index position peaks [1] [O] in the input array data. The second peak’s value/location is contained in peaks [0] [1]/peaks [1][1]. Here peaks [0] contains all the values and peaks[1] contains their corresponding index positions in the data. Note that the size of the returned array depends on the actual input data. For example, the data [3] has a single peak, the data [2,2,2] has no peaks and the data [3,2,3] has two peaks. Show transcribed image text 2 Peak Analysis II [30 marks] The values and locations of the peaks (and plateaus) in data is usually much more important than simply knowing how many peaks there are. In this problem you will find the values and locations of all the peaks. Create a class called FindPeaks with the single static method public static int[ findPeaks (int[] data) The method returns a 2-dimensional array of integers that correspond to the values and locations (in the data array) of all the peaks. The order of the peaks in the output array should correspond to the order of the peaks in the data. For example, the first peak in the input data will be the first peak in the output array. Consider the following code: int[] data = {3,6,7,5,3,-1,1}; int[] [] peaks = FindPeaks. findPeaks (data); // array from problem 1 The peaks variable, after calling findPeaks (data), will be equivalent to the following array int (1) answer = { {7, 1}, {2, 6} }; 1/ peak values 1/ peak locations Here peaks [O] [O] is the value of the first peak which is located at index position peaks [1] [O] in the input array data. The second peak’s value/location is contained in peaks [0] [1]/peaks [1][1]. Here peaks [0] contains all the values and peaks[1] contains their corresponding index positions in the data. Note that the size of the returned array depends on the actual input data. For example, the data [3] has a single peak, the data [2,2,2] has no peaks and the data [3,2,3] has two peaks.
Expert Answer
Answer to The values and locations of the peaks (and plateaus) in data are usually much more important than simply knowing how man… . . .
OR

