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]
3 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]3 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
Someone plz Help I am desperate.
sasho [114]

It would help if there is a programming language in the context of which you need this answered. For instance in Python you can create a program like this:

print(type("Hello"))

print(type(1337))

print(type(True))

print(type("3.14"))

It will return:

<class 'str'>

<class 'int'>

<class 'bool'>

<class 'str'>

8 0
3 years ago
Cd-roms typically use the _______ filesystem type.
marissa [1.9K]
CD-<span>ROMs typically use the ____ filesystem type</span>
8 0
3 years ago
Write a function called average() that takes a single parameter, a list of numeric values. The function should return the averag
QveST [7]

Answer:

The following code is in python.

import statistics as st #importing statistics which include mean function.

def average(lst): #function average.

   return st.mean(lst)#returning mean.

lst=a = list(map(int,input("\nEnter the list : ").strip().split()))#taking input of the list..

print("The average is "+str(average(lst)))#printing the average.

Output:-

Enter the list :

1 2 3 4 5 6

The average is 3.5

Explanation:

I have used the statistics library which includes the mean function that calculates the mean or average of the list.In the function average having lst as an argument returns the mean of the list lst.

Then taking lst input from the user and printing it's average.

3 0
2 years ago
Write a code to load Shepp Logan phantoms and use the radon transform for parallel beam to generate a sinogram for 360 degree ro
jeyben [28]
他們也在週四在家休息時間接受媒體訪問時指出,他們
6 0
2 years ago
Computer Science uses the power of ______________ to solve problems.
Alchen [17]
Computer Science uses the power of computers to solve problems.
8 0
2 years ago
Other questions:
  • Consider a set of mobile computing clients in a certain town who each
    13·1 answer
  • Which type of loop only runs while a condition is true?
    11·2 answers
  • 286795991 número pra convidar no tiktok​
    11·2 answers
  • What network setting do i need for a workgroup?
    5·1 answer
  • What statement would you use to assign the value 32 to the variable cheeses?
    14·1 answer
  • The font color grid is located in the color group on the design tab. (points : 2) true false
    9·1 answer
  • Which statement best describes a transition in PowerPoint?
    12·1 answer
  • Can you guys help me with this coding assignments?
    10·1 answer
  • What's the commission payout for auto bill pay if sold with a ga?
    6·1 answer
  • How have productivity programs improved the professional lives of people? (check all that apply)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!