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
Ivenika [448]
3 years ago
14

Show the steps of a Selection Sort for the numbers ( 5 3 9 5 ).

Computers and Technology
1 answer:
Sedbober [7]3 years ago
3 0

Answer:

Sorted array will be:-

3 5 5 9

Explanation:

In Selection Sort algorithm it sorts the array by repeatedly finds the minimum in the array form the array that is unsorted and swaps it with the value at the first position.

The unsorted array:- 5 3 9 5

In first iteration

minimum is 3.

3 will be swapped with 5.

Now the array is 3 5 9 5

sorted array 3

In second iteration

unsorted array is 5 9 5

sorted array 3 5

and the minimum from it is 5

No swapping will occur.

In third iteration

unsorted array is 9 5

minimum is 5

sorted array 3 5 5

swap it with 9.

Now the array is sorted.

3 5 5 9

You might be interested in
Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less th
Burka [1]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream.h>

#include<stdlib.h>

int main()

{

// Declare variables

int num, selectno;

string status;

randomize();

//Generate random number;

num=rand()%10000;

// Prompt to guess a number

cout<<"You have only 10 tries\nTake a guess: ";

int tries = 0;

while (tries != 10)

{

cin>>selectno;

if(selectno == num){

cout<<"You passed at the "<<count+1<<" attempt";

tries = 10;

}

else

{

cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";

}

tries++;

if(tries >= 10)

{

break;

}

}

return 0;

}

8 0
3 years ago
Write the code to create a variable score and assign it the value 0?​
Galina-37 [17]

Answer:

You can assign a value to a routine variable in any of the following ways:

Use a LET statement.

Use a SELECT INTO statement.

Use a CALL statement with a procedure that has a RETURNING clause.

Use an EXECUTE PROCEDURE INTO or EXECUTE FUNCTION INTO statement.

Explanation:

4 0
3 years ago
Many people dream of being successful, but their actions can sometimes hold them back. What are some ways you can be sure that y
Nikitich [7]

Answer:

  • make a promise
  • write it in a diary
  • make a scrap book
  • create a video
  • make a picture book

I hope this helps

<h2>I know you will do great!!!</h2>

5 0
2 years ago
Write a program that will add the content of two counters every 45 seconds and place the result in an integer register.
nexus9112 [7]

Answer:

Explanation:

The following code is written in Java and runs a thread every 45 seconds that adds the two counters together and saves them in an integer variable called register. Then prints the variable. If this code runs 5 times it automatically breaks the loop. This can be changed or removed by removing the breakLoopCounter variable.

 public static void add_Counters(int counterOne, int counterTwo) {

       int register = 0;

       int breakLoopCounter = 0;

       try {

           while (true) {

               register += counterOne + counterTwo;

               System.out.println(register);

               Thread.sleep(45000);

               breakLoopCounter += 1;

               if (breakLoopCounter == 5) {

                   break;

               }

           }

       } catch (InterruptedException e) {

           e.printStackTrace();

       }

   }

5 0
3 years ago
When looking at a program board at the end of program increment (PI) planning, what does it mean when a feature is placed in a t
IRISSAK [1]

Answer:

It simply means that other teams can independently complete the feature.

Explanation:

PI or program increment is a planning interval during which an agile release train (ART) plans and produces working and tested software and systems. It takes a duration of 8 to 12 weeks

Agile teams can access and independently complete various ARTs found in their swim lanes with no strings.

3 0
2 years ago
Other questions:
  • When activating windows, which type of volume activation is used to activate multiple windows systems, but must be individually
    12·1 answer
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • Numeric data is stored in what for direct processing
    5·1 answer
  • Howard is leading a project to commission a new information system that will be used by a federal government agency. He is worki
    7·1 answer
  • What is a major way that a consumer can protect himself/herself when getting a credit card? A) Making sure that they get a very
    8·1 answer
  • Which is a circuit board located behind an LCD screen on a laptop?
    7·1 answer
  • python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
    7·1 answer
  • In a Java Script language. create a two-dimension array consisting of numbers representing costs. After creating the array, prin
    11·1 answer
  • I only put one answer and didn’t specify what it answered
    14·2 answers
  • Write a program that gets three input characters which are user's initials and displays them in a welcoming message. Then gets i
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!