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
lesya [120]
4 years ago
6

Descending selection sort with output during execution

Computers and Technology
1 answer:
FromTheMoon [43]4 years ago
3 0

Answer:

Check the explanation

Explanation:

Please find the code down

def selection_sort_descend_trace(numbers):

i=len(numbers)

print("Output: ")

for num in range(0,i-1):# traversing from 0 to N-2, total N-1 iterations

val=numbers[num]

start=num+1

end=i

t=0

for j in range(start,end):

if(val<numbers[j]):

remember=j

val=numbers[j]

t=1

if(t==1):# swaping onlf if greater number is available

temp=numbers[num]

numbers[num]=val

numbers[remember]=temp

for p in range(i):# printing

print(numbers[p],end=' ')

print("\n")

if __name__ == "__main__":

print("Enter the integers separated by space: ")

numbers=[int(x) for x in input().split(' ')]

selection_sort_descend_trace(numbers)

Taking input as string and splitting with space as delimiter , converting the split part to integer , finally append in the list.

You might be interested in
Technician A says that it's a good idea to perform a test drive before attempting repairs. Technician B says that it's a good id
Alex Ar [27]

Answer:

Technician A.

Explanation:

Technician A is correct because a technician can detect the fault more accurately as compared to the customer.

3 1
3 years ago
Read 2 more answers
What is a nonlinear presentation
miskamm [114]
It basically means that you skipped slides in what ever you are presenting
8 0
3 years ago
Read 2 more answers
A project manager type a document and print it he is using
IRINA_888 [86]
He is using a Computer to type out the document, and a Printer for printing the document.
Thank you!
3 0
3 years ago
For what purposes do students collect data? Check all that apply.
Bumek [7]

Answer:

sounds like all of the above

Explanation:

only one im not 100% sure on is to examine a question's reliablity

5 0
3 years ago
Read 2 more answers
Need help with these
kolbaska11 [484]
The first one is d the second one is true the third one is false
3 0
3 years ago
Other questions:
  • The eastern front was longer than other fronts of the war true or false
    7·2 answers
  • Describe how mendeleev organized the elements into rows and columns in his periodic table.
    12·1 answer
  • Which one of the following, in addition to disciplinary programs and drug-testing, can employers misuse as a form of retaliation
    8·1 answer
  • Hi, I just have a few questions from my digital tech assignment.
    14·2 answers
  • 8.2 Code Practice Edhesive
    6·1 answer
  • Which is the best choice to explain why a human resource manager is so
    5·1 answer
  • Place the steps for attaching a file to a message in order from top to bottom.
    12·1 answer
  • Why do you need to put your phone on airplane mode.
    14·1 answer
  • can i get an access code for free online? if yes, what website is it so i can get a free access code?​
    15·1 answer
  • Which response best completes the following IF-ELSE statement?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!