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
Zinaida [17]
3 years ago
6

Write a recursive function that returns 1 if an array of size n is in sorted order and 0 otherwise. Note: If array a stores 3, 6

, 7, 7, 12, then isSorted(a, 5) should return 1 . If array b stores 3, 4, 9, 8, then isSorted(b, 4) should return 0.int isSorted(int *array, int n){
Computers and Technology
1 answer:
Tanzania [10]3 years ago
4 0

Answer:

Here the code is given as follows,

Explanation:

Code:-

#include <stdio.h>  

int isSorted(int *array, int n) {

   if (n <= 1) {

       return 1;

   } else {

       return isSorted(array, n-1) && array[n-2] <= array[n-1];

   }

}  

int main() {

   int arr1[] = {3, 6, 7, 7, 12}, size1 = 5;

   int arr2[] = {3, 4, 9, 8}, size2 = 4;  

   printf("%d\n", isSorted(arr1, size1));

   printf("%d\n", isSorted(arr2, size2));

   return 0;

}

Output:-

You might be interested in
Can someone plss help me!!
REY [17]

Answer:

HTML elements are delineated by tags, written using angle brackets.

Explanation:

Tags such as <img /> and <input /> directly introduce content into the page.

8 0
2 years ago
3. What are two reasons for versioning your still life project file? (1.0 points)
inna [77]

Answer:

The project file can be managed by making its multiple version due to the following reasons.

1. We can create multiple copies or version of the project to avoid any unfortunate circumstance such as Project file can be corrupted or can be deleted. In that case we can use the other version of that project file.

2. When we are working on some project, we are modifying the code or program to achieve our desired results. In this process we may forgot the changes that we have made while modification. If we does not obtain our desired results while modification that can lead to losing the original file. To reduce this type of risk we create multiple versions of project File.

3. We also create version of our project files on some internet drives as a backup. In case our computer has lost or operating system has been corrupted. A version of our project file is available on Internet drives such as Google drive or Drop box.

3 0
3 years ago
What feature did we use to quickly apply the formatting shown in this image?
hammer [34]

Answer:

Conditional formatting.

Explanation:

Conditional Formatting is the method that main objective to enabling the users for setting the formatting to the  cell or the cell range as well as it adjust the layout based that are based on the cell value or the formula value.

  • The Conditional formatting making the cell value as bold as in the given question we see that the cell value is bold  when the given condition is true.
  • The objective of pivot table is to summarizing the data it do not provide the formatting that's why this option is incorrect .
  • The objective of what if analysis is altering the absolute value of worksheet also it see how some modifications will influence the result of the worksheet formulae in the spreadsheet it do not provide the formatting that's why this option is incorrect .
  • Data scenario formatting do not provide the formatting that's why this option is incorrect .

3 0
3 years ago
Slide rule was the first mechanical calculator. true or false​
drek231 [11]

Answer:

False. Pascal's calculator was the first mechanical calculator invented by Blaise Pascal in the mid 17th century.

7 0
3 years ago
Read 2 more answers
Do you think that smart televisions are going to replace media players?
VLD [36.1K]

Answer:

yes because smart television give more information

8 0
2 years ago
Other questions:
  • What types of information would be entered in a Microsoft Word table ?
    11·1 answer
  • To configure a router / modem, what type of IP interface configuration should you apply to the computer you are using?
    8·1 answer
  • Shelby likes to play video games on an old Atari video game system. No matter how old the cartridge, when she inserts it into th
    14·2 answers
  • You have just installed a SOHO router in a customer’s home and the owner has called you saying his son is complaining that Inter
    9·1 answer
  • The purpose of this assignment is to determine a set of test cases knowing only the function’s specifications, reported hereaf
    12·1 answer
  • What does this mean, i am so confused- Explain the importance of identifying the purpose/use for pre-production documents
    9·1 answer
  • Finish the program by choosing the correct terms.
    7·2 answers
  • Java !!!
    10·1 answer
  • You are an IT network administrator at XYZ Limited. Your company has critical applications running of its Ubuntu Linux server. C
    6·1 answer
  • MODERATOR DELETE MY ACC
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!