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
Which of the following are NOT two of the best ways to StaySafe around electricity? A. Maintain a safe distance from overhead po
kherson [118]

The answer is option C: Use ground-fault circuit interrupters, and inspect extensions cords and portable tools.

Inspecting the extension cords needs to be done constantly, or there can be abrasions or cuts that won't be noticed. Option B remains one of the most important ways to be safe around electricity. Always wear non-conductive safety equipment, such as safety goggles or rubber gloves. You should also avoid touching exposed metal. Option C indicates one of the two ways that do not help you stay safe around electricity. A ground fault interrupter only works if there is a short circuit or a huge amount of energy going through that point and thus, will not effectively protect you from possible incidents with electricity.


3 0
3 years ago
Read 2 more answers
An organization has a website with a guest book feature, where visitors to the web site can input their names and comments about
kozerog [31]

Answer:

B

Explanation:

6 0
3 years ago
Read 2 more answers
A _____ is a web site made up of content posted by users. each page has an "edit" link.
vladimir2022 [97]
A wiki page is made up of collaborative content by users who can edit and delete content as it is seen fit.  These pages began out on Wikipedia, as the name can tell, but they have spewed into other genres of internet content.  A lot of wiki pages have been made for certain subcultures and groups, and these guys have the same general idea.  Anyone can edit and do whatever with it, and that's why you can't use it as a reliable source in school.
3 0
3 years ago
Which two skills and abilities are essential for a ship captain
Ierofanga [76]

Answer:Leadership/guidance/public speaking/communication

Explanation:

6 0
4 years ago
Which partitioning method must be used for partitioning a 4 terabyte hard drive
Harrizon [31]
ExFAT would be the answer. 
8 0
3 years ago
Other questions:
  • What is the theoretical maximum capacity (in bps) for a wireless link, with spectrum ranging from 30GHz to 60GHz, and with an SN
    6·1 answer
  • Write code to print the location of any alphabetic character in the 2-character string passCode. Each alphabetic character detec
    10·1 answer
  • Write a program that asks the user for a CSV of the NYC Open Data Film Permits: There is a sample file for June 2019 film permit
    9·2 answers
  • 6.13: Word Count
    15·1 answer
  • Assume that the following table is created and stored in your database:
    5·1 answer
  • The difference between a checked and an unchecked exception is:
    10·1 answer
  • FIRST AMSWER GET BRAINLIEST​
    13·1 answer
  • Which of these is true about moores law
    6·1 answer
  • Below functions flatten the nested list of integers (List[List[int]]) into a single list and remove duplicates by leaving only t
    15·1 answer
  • Routing and remote access services allow users to connect to private networks using or:.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!