1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
HACTEHA [7]
3 years ago
6

Consider the following method, which is intended to return the number of local maximum values in an array Local maximum values a

re array elements that are greater than both adjacent array elements. The first and last elements of an array have only a single adjacent element, so neither the first nor the last array element is counted by this method. For example, an array containing the values (3. 9. 7, 4, 10, 12, 3, 8) has two local maximum values: 9 and 12 public static int count Peaks(int[] data) int nunPeaks - e; for (/" missing Loap header */ ) if (data[p. 1] data p + 1]) nunPeaks++; return numeaks,
Which of the following can replace /* missing loop header / so the method count Peaks works as intended?

a. int p - data. Length - 1p > ; P-
b. int p - P < data.length; ptt int p .
c. p < data. length - 1; put int p = 1;
d. p
Computers and Technology
1 answer:
Setler79 [48]3 years ago
4 0

Answer:

Replace the comment with:

int p = 1; p < data.length - 1; p++

Explanation:

See attachment for proper format of the code

The loop header is expected to test if the current element is greater than the adjacent elements (i.e. array elements before and after it)

It should be noted that the first element of the array (index 0) has not element before it and the last element of the array has no element after it.

So, the loop header must start from index 1 and end at the last index - 1

The option that illustrates this is:

int p = 1; p < data.length - 1; p++

You might be interested in
u arrive at an intersection with traffic lights that are not working because of a power outage. What do you do?
maxonik [38]
Go to o rilles or autozone
5 0
4 years ago
Which of the following declares an abstract method in an abstract Java class?
slava [35]

The option that declares an abstract method in an abstract Java class is  option(B.) public abstract void method().

<h3>In Java, are abstract methods compatible with abstract classes?</h3>

Class and method abstraction is when Objects cannot be created using the abstract class, which is a restricted class. In addition to not having a body, an abstract method is only applicable to abstract classes. Subclasses provide the body.

Hence, consists of only the method definition and not any implementation. An Abstract Method is a method that doesn't have a body. A class that is abstract must declare it. Due to the need for the abstract class to implement each abstract method, the abstract method can never be considered final.

Learn more about abstract method from

brainly.com/question/15684705
#SPJ1

8 0
2 years ago
Regarding the Internet of Things (IoT), a business involved in utilities, critical infrastructure, or environmental services can
love history [14]

Answer:

The answer is False

Explanation:

IOT or Internet of things refers to the multiple devices in the world today, which are connected to the internet, they gather and share specific information. Any physical object can become an IOT device once it can be connected to the internet to control its data.

Since, the business is involved in utilities, critical infrastructure, or environmental services, it will not benefit from traffic-monitoring applications.

7 0
4 years ago
Where should a "deny all catch all" rule be positioned and why?<br> pleaseeee help!
insens350 [35]

Answer: For best performance and lowest latency, the MMU and CPU should support hardware ... broadcast, and subnet broadcast traffic with the deny-all catch-all filter rule for ... Please refer to the NetSight Wireless Manager User Guide (v5.1 or higher ) for a ... The rule must also be positioned above the 'Deny All' Default action.

Explanation:

6 0
4 years ago
Read 2 more answers
It skills which move well between industries are considered?
Butoxors [25]

Answer:

They are termed as ethics. But remember different industries have a different set of ethics or rules that they expect their employees to follow. However, some that go well with all are common to all. And they are the standard ethics that are followed by all the industries. Failing to these is never expected.

Explanation:

Please check the answer section.

6 0
3 years ago
Other questions:
  • Using a USB flash drive, you intend to install Windows 10 on several computers. To save time, you would like to automate the
    13·1 answer
  • Assume that you have an array of integers named arr. The following program segment is intended to sum arr [0]through arr[n−1], w
    7·1 answer
  • The it department is reporting that a company web server is receiving an abnormally high number of web page requests from differ
    13·1 answer
  • Excel allows you to rotate text in a cell counterclockwise by entering a number between -1 degrees and -90 degrees. True or fals
    14·1 answer
  • What are the core components of a computer system?
    14·1 answer
  • Pls help me with this pls
    7·2 answers
  • What are the missing letters _A_TO_ ( 6 letters) a type of computer.
    13·2 answers
  • How do u reverse image search on Android? ​
    9·1 answer
  • What is an input and output device? Give examples.​
    8·1 answer
  • What is one of the disadvantages of a server-based network compared to a peer-to-peer network?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!