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
Elena-2011 [213]
2 years ago
11

Evaluating sorts given the following array: 41, 32, 5, 8, 7, 50, 11 show what the array looks like after the first swap of a bub

ble sort in a scending order.
Computers and Technology
1 answer:
irga5000 [103]2 years ago
8 0

The way that  the array will looks like after the first swap of a bubble sort in ascending order is   {5,32,41, 8,7,50,11}.

<h3>Who do you Write sort code in JAVA?</h3>

It will be:

class SSort

{

  void sort(int array[])

  {

      int n = array.length;

      for (int i = 0; i < 2; i++)

      {

          int minimum_index = i;

          for (int j = i+1; j < n; j++)

              if (array[j] < array[minimum_index])

                  minimum_index = j;

           int temp = array[minimum_index];

          array[minimum_index] = array[i];

          array[i] = temp;

      }

  }

   void printArray(int array[])

  {

      int n = array.length;

      for (int i=0; i<n; ++i)

          System.out.print(array[i]+" ");

      System.out.println();

  }

  public static void main(String args[])

  {

      SSort s = new SSort();

      int array[] = {41, 32, 5, 8, 7, 50, 11};

      s.sort(array);

      System.out.println("After first two iteration of Selection sort:");

      s.printArray(array);

  }

}

Therefore, The way that  the array will looks like after the first swap of a bubble sort in ascending order is   {5,32,41, 8,7,50,11}.

Learn more about array  from

brainly.com/question/26104158

#SPJ1

You might be interested in
Why is computer called information processing machine....?​
mixer [17]

Answer:

Since the computer accepts raw data as input and converts into information by means of data processing

Explanation:

helping!!!

3 0
2 years ago
Read 2 more answers
Help me with the question please..​
PIT_PIT [208]

First addition, then division

4 0
3 years ago
What is the default text-wrapping option when inserting images into a Word document?
JulijaS [17]

Answer:

In line with the text

Explanation:

8 0
3 years ago
Read 2 more answers
How is an amp meter connected in a circuit to measure flow of electrons
Leno4ka [110]
R=0 of the amp meter so it can be placed in the circuit
7 0
3 years ago
Read 2 more answers
Please tell fast plzzzzzz.​
lana [24]

Answer:

True

Explanation:

4 0
3 years ago
Other questions:
  • Which elements in a web page require a visitor’s action?
    15·1 answer
  • A dropped packet is often referred to as a _____________.
    7·1 answer
  • Endnotes into a document are automatically positioned at the bottom of the page where the endnote reference is inserted.
    5·1 answer
  • Being able to express your thoughts in an email is a primary technology skill. True or False
    8·2 answers
  • It is important for a writter to include voice and point of view in writting because _______
    11·1 answer
  • Method x1() has code that calls method x2(). Method x2() has the following header.
    7·1 answer
  • Which button will allow you to insert quotes and notes into text into a document​
    12·1 answer
  • Why is it NOT a good practice to save everything on the desktop?
    6·2 answers
  • If you could represent yourself with one object from your home what would it be ?
    9·2 answers
  • Work-based learning can be defined as educational experiences that focus on
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!