![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 07.10.2020 23:01 Nicoleycannolii
Write a program to find a peak in an array of ints. Suppose the array is {-1, 0, 2, 5, 6, 8, 7}. The output should be "A peak is at array index 5 and the value is 8." This is because the value 8 is larger than its predecessor 6 and its successor 7 in the given array. Note that 8 occurs at index 5. (The array starts at index 0.) A number at index i in an array X is considered a peak if: X[i]>=X[i-1] and X[i]>=X[i+1]. If i is at the beginning of the array, then peak is if X[i]>=X[i+1]. If i is at end of array, then peak is if X[i]>=X[i-1].
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 21:10, itsmichaelhere1
Dameas communication challenge is due to which factor
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 03:30, bellsbella34
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
You know the right answer?
Write a program to find a peak in an array of ints. Suppose the array is {-1, 0, 2, 5, 6, 8, 7}. The...
Questions in other subjects:
![Konu](/tpl/images/cats/istoriya.png)
History, 10.03.2021 22:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 10.03.2021 22:00
![Konu](/tpl/images/cats/istoriya.png)
History, 10.03.2021 22:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 10.03.2021 22:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 10.03.2021 22:00
![Konu](/tpl/images/cats/biologiya.png)
Biology, 10.03.2021 22:00
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 10.03.2021 22:00