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
juin [17]
4 years ago
8

An array is sorted (in ascending order) if each element of the array is less than or equal to the next element .

Computers and Technology
1 answer:
Aleks04 [339]4 years ago
8 0

Answer:

// The program below checks if an array is sorted or not

// Program is written in C++ Programming Language.

// Comments are used for explanatory purpose

//Program Starts here

#include<iostream>

using namespace std;

//Function to check if the array is sorted starts here

int isSorted(int arr[], int count)

{

// Check if arrays has one or no elements

if (count == 1 || count == 0) {

return 1;

}

else

{

// Check first two elements

if(arr[0] >= arr[1])

{

return 0; // Not sorted

}

else

{ // Check other elements

int check = 0;

for(int I = 1; I<count; I++){

if (arr[I-1] > arr[I]) { // Equal number are allowed

check++; // Not sorted

}

}

}

if(check==0)

return isSorted(arr, count - 1); //Sorted

else

return 0; // Not sorted

}

// Main Method starts here

int main()

{

int count;

cin<<count;

int arr[count];

for(int I = 1; I<=count; I++)

{

cin>>arr[I-1];

}

int n = sizeof(arr) / sizeof(arr[0]);

if (isSorted(arr, n))

cout << "Array is sorted";

else

cout << "Array is not sorted";

}

You might be interested in
Differences between iphone 6 and 6s
amid [387]
I phone 6s is bigger than a regular iphone and iphone 6s's dosn't bend like iphone 6
4 0
4 years ago
Describe the importance of prioritizing your focus when designing for multiple purpose
sp2606 [1]
<span>While Designing for Multiple purpose the prioritizing our focus is an essential part, when missed can lead to vague information and may spoil the sole purpose of the product that was meant to be designed. Our focus should always point to the MVP or Minimum Viable Product that needs to be delivered and on top what type of aspects we bring in to serve the multiple purpose need. The focus on order of prioritization should never be compromised unless there is something very essential that was left without incorporating at the designing stage.</span>
3 0
3 years ago
A four-year old laptop will not boot and presents error messages on screen. You have verified with the laptop technical support
storchak [24]

Answer:

The first question you should ask yourself before performing the repair is Option B. Can you find a replacement motherboard.

Explanation:

According to me, I would ask “Can you find a replacement motherboard”.

Because, Always the laptop charge will be more than the charge of a mother board, because motherboard is just a part and the laptop consists of other important parts too. So Option (a) is not the wise selection.

Let’s look into option D. Warranty period should be verified by us and not the technical person, because we have purchased and we have the warranty card.

Let’s look into option C. The technical person will already be well-versed with fixing solution and diagnosing problem. So service manual will be of not much use to him and he would want to make money out of fixing the problem, so we cannot expect him to teach us how to replace a motherboard.

5 0
4 years ago
1. What does it mean to say that a country’s land area is positively correlated with its population?
disa [49]
For 1.
Positive correlation means if you plot a country's population and land size on a graph. There would be a linear regression line that's sloping upwards. 

Since it's a scatterplot, there will be some that fall out of the line, but most of them should be on the line.

It's  (A)

For 2.
An outlier is a datapoint that's far, FAR away from the others, so it's (B)

For 3. (A), it's a single line-of-best fit that runs through the middle of the cluster of data points.
5 0
3 years ago
Read 2 more answers
How was science used to make television?
Wewaii [24]

Answer:

Sir William Crookes invented the cathode ray tube in 1878, but these discoveries took many years to merge into the common ground of television. His mechanical system used a scanning disk with small holes to pick up image fragments and imprint them on a light-sensitive selenium tube. A receiver reassembled the picture.

5 0
3 years ago
Read 2 more answers
Other questions:
  • What is a organisation in office technology
    7·1 answer
  • What's the problem with this code ?
    14·1 answer
  • What is DBMS software used for?
    5·1 answer
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • Do you get notified if someone follows you on Spotify like your email or do you just have to find out on your own
    14·1 answer
  • If you were writing a story set in our time, what would you include to give readers a sense of our world? Check any that apply.
    5·1 answer
  • Can someone please explain this issue to me..?
    12·2 answers
  • Line installers must complete a four-year university degree program in order to be hired.
    5·2 answers
  • Which is the smallest form of data <br>a)bit <br>b)byte<br>c)nibble<br>d)8 binary digits<br>​
    10·1 answer
  • Write a function that simulates the roll of a six-sided dice. The name of the function is rollDice. The function accepts no para
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!