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
By generating and delivering timely and relevant information supported by networks, _____ creates new opportunities for conducti
castortr0y [4]

Answer:

The correct option to the following question is option (B). e-business.

Explanation:

E-business is stands for the Electronic business.

E-business is the business which is conduct by the uses of the internet, Web, extranet or intranet, etc.

E-business is also known as the online business where online transactions take place.

E-business facilitates our customers that the selling and the buying of the goods between the consumers and the merchants.

7 0
3 years ago
Why Embedded operating systems are also known as real-time operating systems (RTOS)?
kati45 [8]

Answer:

A real-time operating system is an operating system designed to support real-time applications that, usually without buffer delays, process data as it comes in. A real-time system is a time-bound system that has fixed, well defined time constraints.

6 0
3 years ago
How to control what is on the x and y axis in excel?
kozerog [31]
The value on X you choose first and create a graph then you add values to graphs Y axis.
8 0
3 years ago
Which function is going to find the lowest value in a range of numbers? MIN MAXAVERAGE COUNT
never [62]
Min is the correct bicycle
8 0
3 years ago
Comment if u wanna text me on behance
kow [346]

Answer:

what is behance? :)

Explanation:

4 0
3 years ago
Other questions:
  • An attribute whose value uniquely identifies an object is called a(n) _______.​
    15·1 answer
  • Susan will be configuring a snort network ids sensor to monitor her subnetwork. she will be using a web-based console interface
    8·1 answer
  • A report formatted where the page is taller than it is wide is formatted in ____.
    12·1 answer
  • Playstation network live updates pes 2018 does it cost extra
    13·1 answer
  • Solve the following equations and check your result 1) 3x=2x+18​
    5·2 answers
  • Which device assists with medical imaging? HELPPPP!!!!!!
    12·1 answer
  • Computer privacy typically occurs when which of the following is violated?
    6·1 answer
  • graphic designers can compress files in different formats . One of the formats ensures that the quality and details of the image
    7·1 answer
  • Adding Page Numbers in the Footer
    15·1 answer
  • How do you reflect yourself in the topic (filters)​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!