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
Steve left his computer switched on in his room and went out to have breakfast. When he returned, he saw that the monitor had be
yanalaym [24]

Answer:

B

Explanation:

5 0
3 years ago
Write a program to calculate the
marishachu [46]

Answer:

blep blep blep belp belp belp belp belp belp BELPPPPPPPPPP

5 0
3 years ago
What is true about the dilation?
madreJ [45]

Hey hey hey! I recently took the test and the answer is D | (• ◡•)|

7 0
3 years ago
Read 2 more answers
What computer worm was used to sabatoge iran's nuclear program?
Stels [109]
Researches at symantec have uncovered a version of the stuxnet computer virus that was used to attack irans nuclear program in November.
4 0
3 years ago
WHAT ARE THE RISK OF DUST​
Step2247 [10]

Answer:

over heating

Explanation:

in computers dust acts as a blanket which traps heat, excessive heat causes components to burn up and short out

3 0
3 years ago
Other questions:
  • All animations on the world wide web are flash animations
    11·2 answers
  • What is the output of the second println statement in the main method? public class Foo { int i; static int s; public static voi
    14·1 answer
  • . When a function template has two parameterized types, one as the return value, and one as an argument, then _____.
    11·1 answer
  • How can you represent a graphic element in a wireframe?
    5·1 answer
  • What can provides access to the only menu in office 2007​
    13·1 answer
  • What is digital scavenger hunting? A. An application that locates addresses B. A scavenger hunt where players use GPS and digita
    5·1 answer
  • I need help picture above
    14·2 answers
  • A SOCCER club uses ICT to
    10·1 answer
  • Will give brainliest
    8·1 answer
  • Complete the sentence.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!