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
11111nata11111 [884]
4 years ago
9

Write an algorithm for a method (say is Descending) that accepts an integer arrays (say A) as input parameter, and returns a boo

lean value true if the elements in the array are in descending order. Example 1: Formal Parameters: A = { 1, 2 , 3, 4 } Return : False Example 2: Give Formal Parameters: A = { 4, 3, 2, 1 } Return : True Example 3: Formal Parameters: A = { 4, 3 , 1, 2} Return : False
Computers and Technology
1 answer:
Neko [114]4 years ago
4 0

Answer:

Check the explanation

Explanation:

Algorithm for determining if the array passed as argument is in descending order or not.

1. Start

2. A = {1, 2, 3, 4};

3. Call function by passing array and it's size.

   isDescending(A, A.length);

4. Loop from 1 to size - 1 (inclusive)

5.     check if element at (i-1)th index is greater than element at (i)th index or not

6.     if at any point the above expression is executed to true value then return false

7.     if the above if statement is not executed then loop will terminate it self

8. Now return true.

// Java Implementation:

public static boolean isDescending(int[] arr, int size) {

   for (int i = 1; i < size; i++) {

       if (arr[i-1] > arr[i]) {

           return false;

       }

   }

   return true;

}

You might be interested in
You can press the ____ keys to open the Format Cells dialog box.
Kobotan [32]
You can press the 1 + Control(CTRL).
4 0
3 years ago
How do you remove management from your chrome book [administrator]
torisob [31]

I’m pretty sure you shouldn’t because in the form they have you fill I think you agree to something about the management so..

3 0
3 years ago
Select all that apply.
rosijanka [135]

Answer:

don't overuse special effects, match special effects to content, use consistent transitions for each slide

Explanation:

I found this on quizlet.

6 0
3 years ago
What’s let’s you see your mouse on the screen in order to click icons, buttons , and menus
tatyana61 [14]

Answer: Easy one.

Explanation:

This would be the OS. The OS has a mouse cursor for you to use in Windows, and Linux, it's the same thing for some BIOS'es aswell, and this goes for setting up Windows, or Linux off of a flash drive or CD.

7 0
3 years ago
What is the difference between a form header and a page header?
Sindrei [870]
A form header is always displayed on the screen of the computer. it can be useful in the display of independent information that concerns the current record. However, the page header is not displayed on the screen of computer but in every printout it is printed on the top.
<span />
7 0
3 years ago
Other questions:
  • What does the hard drive do
    10·2 answers
  • again assume that each of the resistors in the circuit shown above has a resistance value of 100k(question in the picture above)
    9·1 answer
  • How do airbags prevent injury?
    13·1 answer
  • Say you are running a program along with many other programs in a modern computer. For some reason, your program runs into a dea
    7·1 answer
  • Digital cameras always create great photographs. <br>True <br>False
    14·2 answers
  • Given the code below, which three statements can be used to create the controller variable?
    5·1 answer
  • Match the command to the use. Test connectivity to a remote computer Test DNS lookup View packets in a transmission Display the
    14·1 answer
  • Define E-Mail Write any 4 special features of E-Mail ​
    13·1 answer
  • What is bit in computer science? (You must select all correct answers.) Hb. A. A part of a tool, such as a router. Non. B. A bas
    6·2 answers
  • What is the advantage of learning through story compared to learning through personal experience?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!