Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python Write a program to sort a list of value from largest to smallest using Selection Sort. The algorithm should sort-in-place and not create

using python

Write a program to sort a list of value from largest to smallest using Selection Sort. The algorithm should sort-in-place and not create a second array of sorted values

Challenge write a second function that sorts the list, but keeps the original list unsorted and returns a new sorted list. Hint: one approach is to create a copy of the original list and then sort it

Use the following main to test the code

# ------- main ----------

a = [4,2,7,6,3,4,1,9,7,6,2] mysort(a) print(a)

b = ["alpha", "sierra", "victor", "echo", "millie" ] mysort(b) print(b)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions