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
Leno4ka [110]
4 years ago
10

java The maximum-valued element of an integer-valued array can be recursively calculated as follows: If the array has a single e

lement, that is its maximum (note that a zero-sized array has no maximum) Otherwise, compare the first element with the maximum of the rest of the array-- whichever is larger is the maximum value. Write an int method named max that accepts an integer array, and the number of elements in the array and returns the largest value in the array. Assume the array has at least one element.
Computers and Technology
1 answer:
adoni [48]4 years ago
7 0

Answer:

see explaination

Explanation:

MaxArray.java

public class MaxArray{

public static void main(String[] args) {

int a[] = {1,2,5,4,3};

int max = max (a, 5);

System.out.println("Max value is "+max);

}

public static int max (int a[],int size){

if (size > 0) {

return Math.max(a[size-1], max(a, size-1));

} else {

return a[0];

}

}

}

Output:

MaxArray

You might be interested in
Drag the tiles to the correct boxes to complete the pairs.
MAXImum [283]
Shift+3 hash mark
Shift+5 percent
Shift+7 ampersand
Shift+6 caret
6 0
4 years ago
Which of these are examples of skills?
Allushta [10]

Answer:

bruh

Explanation:

momento

8 0
3 years ago
Read 2 more answers
The physical components of information technology, which can include the computer itself plus peripherals such as storage device
yarga [219]
The correct answer should be Hardware
8 0
3 years ago
Consider the following class:
Pachacha [2.7K]

Answer:

c.return Integer.compare(value, otherTemp.value)

Explanation:

The compare() method as the name implies compares two integer values. If they are equal it returns 0, if the first number is smaller it returns -1, and if the first number is greater it returns 1.

It is an Integer class method that is why you need to type Integer.compare() to call the function.

For this example, the parameters that will be compared are <em>value</em>, and <em>otherTemp.value. </em>The type of compareTo method is an integer, we need to return the result.

3 0
3 years ago
Which method would be the BEST to protect security information and event management (SIEM) log data at rest from tampering by au
AnnyKZ [126]

Answer:

Option B (Deployment of write once read many (WORM) drives) is the appropriate one.

Explanation:

  • SIEM application goods/services consolidate safety information management (SIM) with security event management (SEM) throughout the area of device protection. We include an overview including its known vulnerabilities created by users and network equipment in actual environments.
  • No quantity of administrative intervention will alter the substance on something like a WORM disc, even by physical disc disruption or failure. That would be the better-suggested choice.
7 0
4 years ago
Other questions:
  • The number of pixels displayed on the screen is known as ________.
    14·1 answer
  • Conduct online research on web authentication and define what it is. Describe different authentication methods
    5·1 answer
  • Plzzzzz help right answer gets Brainly
    10·1 answer
  • Is something wrong with Brainly?
    5·2 answers
  • What are the differences between the various EHRs?
    9·1 answer
  • What is different between attaching a file on an email program versus a smartphone?
    12·2 answers
  • Will my ethernet adapter stop eveyone from getting WiFi if connected to my laptop ?
    5·1 answer
  • A pointer is the memory address of a variable. FALSE TRUE
    9·1 answer
  • The Quick Access tool bar allows you to customize the actions or commands you frequently use.
    13·1 answer
  • Help me plz and thank .......................................
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!