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
goldenfox [79]
4 years ago
10

Consider the following list.list = {24, 20, 10, 75, 70, 18, 60, 35}Suppose that list is sorted using the selection sort algorith

m as discussed in the book. What is the resulting list after two passes of the sorting phase; that is, after two iterations of the outer for loop?list = {10, 18, 24, 20, 75, 70, 60, 35}list = {10, 18, 20, 24, 75, 70, 60, 35}list = {10, 18, 24, 75, 70, 20, 60, 35}list = {10, 20, 24, 75, 70, 20, 60, 35}
Computers and Technology
1 answer:
DochEvi [55]4 years ago
5 0

Answer:

list = {10, 18, 24, 75, 70, 20, 60, 35}

Explanation:

In selection sort 1st element of array is compared with all elements in list. If there is any element smaller than any other element in the list,  that will be swap with first element as

1st iteration:

in given list first element is 24, this will compare with whole list and find the number that is smaller than any other element in list. there 10 is smallest element in the list so in first iteration the list is given as:

list = {10 , 20, 24, 75, 70, 18, 60 ,35}

2nd Iteration:

After first iteration the smallest element of list will comes at first position. Now we start with 2nd position of list. 2nd element of the list will be compared with all other elements except 1st element. The 2nd smallest element of the list will be replaced with 2nd element of array.

In 2nd iteration, 18 is 2nd smallest element in the list so that will be swap with 2nd element of list. now the list is given as after

list = {10, 18, 24, 75, 70, 20, 60, 35}

You might be interested in
Help I will mark brain list I promise!!
Valentin [98]

Answer:

we need more explanation

6 0
3 years ago
Please help me with these questions please
sp2606 [1]

Answer: i think its 30.

4 0
3 years ago
What happen if there is no authentication??
creativ13 [48]

Answer:

anyone could access something and hack others

Explanation:

7 0
3 years ago
Read 2 more answers
To create an effective study schedule, a student must guess the amount of time needed for studying. write down all activities an
Inessa [10]

Answer:

B) write down all activities and commitments

Explanation:

It seems the most logical.

3 0
3 years ago
Read 2 more answers
Tricia listed her assets and liabilities. Credit Card Bill Car Loan Bonds Piano Bank Account Bicycle Which are Tricia’s liabilit
DIA [1.3K]
<span>Her liabilities are her credit card bill and her car loan. These are things that she owes and has to pay off, so they are liabilities due to the fact that she owes for these items. Her bonds, piano, bank account, and bicycle are counted as assets.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Create a program to calculate the wage. Assume people are paid double time for hours over 60 a week. Therefore they get paid for
    10·1 answer
  • In the lecture, we saw that TCP waits until it has received three duplicate ACKs before performing a fast retransmit. Why do you
    10·1 answer
  • Se Statements
    6·1 answer
  • This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by
    8·1 answer
  • You are planning to buy a new server that will act as the server portion of a client/server application. A colleague of yours ma
    9·1 answer
  • Examine the following algorithm.
    9·1 answer
  • In an inspection, usually the first thing an inspector will want to see is:
    14·2 answers
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. Certain project
    11·1 answer
  • Computer science is a blank process
    6·2 answers
  • Different between embedded computer &amp;<br> Micro controllers
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!