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
natka813 [3]
3 years ago
9

Write a void function SelectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The fu

nction should use nested loops and output the array after each iteration of the outer loop, thus outputting the array N-1 times (where N is the size). Complete main() to read in a list of up to 10 positive integers (ending in -1) and then call the SelectionSortDescendTrace() function.
If the input is:

20 10 30 40 -1
then the output is:

40 10 30 20
40 30 10 20
40 30 20 10
Computers and Technology
1 answer:
salantis [7]3 years ago
8 0

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

void SelectionSortDescendTrace(int numbers[], int numElems) {

int maxInd;

for (int i = 0; i < numElems - 1; ++i) {

maxInd = i;

for (int j = i; j < numElems; ++j) {

if (numbers[j] > numbers[maxInd]) {

maxInd = j;

}

}

int temp = numbers[i];

numbers[i] = numbers[maxInd];

numbers[maxInd] = temp;

for (int j = 0; j < numElems; j++) {

cout << numbers[j] << " ";

}

cout << endl;

}

}

int main() {

int numbers[10];

int numElements = 0;

for (int i = 0; i < 10; i++) {

cin >> numbers[i];

if (numbers[i] == -1)

break;

++numElements;

}

SelectionSortDescendTrace(numbers, numElements);

return 0;

}

You might be interested in
Given that ∠XQR = 180° and ∠LQM = 180°, which equation could be used to solve problems involving the relationships between ∠XQM
mr Goodwill [35]

C) 180 − (140 − 7a) = (70 − 3a)

Answer:

C) 180 − (140 − 7a) = (70 − 3a)

Explanation:

i got it wrong by clicking D on usatestprep

4 0
3 years ago
(photoshop cc)
iren2701 [21]
Black Point<span> Compensation option </span>controls whether to adjust for differences in black points when converting<span> colors </span>between color spaces<span>.

A is the answer :)

</span>
5 0
3 years ago
A spiked collar that extends horizontally for up to 3 feet from the pole is an example of what kind of technology? and that no u
slega [8]

This technology is known as an anti-climb collar.

Spiked collars are used to protect equipment mounted on poles like CCTV or in areas where you can easily climb a pole over a security fence. This technology offers a very simple and practical solution to protecting poles against thieves and vandals.

3 0
3 years ago
Diana is running a successful remarketing campaign. She wants to expand her reach with other targeting options. While creating a
mart [117]

Answer:

B: Audience interest around different topics.

Explanation:

When using Google Ads, and the main aim is to create a campaign for a particular marketing activity, there are several options that makes Google Ads the ideal application for this purpose. However, choosing similar audiences under the targeting option is simply telling google to find users or audiences that are interested in the different topics, but are in one way or the other connected to your marketing activity or campaign.

8 0
3 years ago
It is next to impossible for someone to prove that information I used in a class assignment came from somewhere on the Internet/
Rashid [163]

Answer:

False

Explanation:

It is wrong to say that plagiarism can not be detected, there is a wide range of technologies available to prove that the information provided that a person is gotten directly from a source and it was not His own words. Plagiarism checking tools include web applications and software made to check plagiarism and they available for use, most of which are paid software and some are free.

3 0
3 years ago
Other questions:
  • A computer which links several pcs together in a network is called
    10·1 answer
  • Which of the following would be a tradeoff of a scientific advancement that enables us to catch fish from the ocean faster than
    5·1 answer
  • A porta power tool is what kind of tool
    9·1 answer
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • Before creating a brief to design a product, what is needed
    8·1 answer
  • Encoding a video format and then decoding it during playback is one of the functions of MPEG-4 and H.264 file players. MPEG-4 an
    13·2 answers
  • Which of the following technologies is an example of social media
    12·1 answer
  • Which of the following is a primary disadvantage of using a GUI HTML editor to develop your Webpages?
    10·1 answer
  • Can someone follow my tt its c1ndy.dont.miss
    6·1 answer
  • Do software engineers save millions of dollars in usa
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!