10 Prepare : Checkpoint A - Selection Sort
After completing (or while completing) the preparation material for this week, complete the following exercise.
Overview
This checkpoint is intended to help you practice the syntax of a basic sorting algorithm.
Instructions
For this assignment, you need to implement selection sort and use it to sort an array of integers.
Begin with this template file: sorting.py
Functions are provided for you that prompt the user for a list, pass it to a function to be sorted, and finally display it.
Your task is to fill in the body of the
sortfunction.Please note that the reading assignment for this week contains the actual code for this algorithm. You should not simply copy and paste this (or copy it down directly by typing it in). Instead, first gain an understanding of the algorithm, then try to implement it based on your understanding. If you get stuck, you can go look at the reading again, try to understand the approach, then close it, and go back to your code.
Testbed
An auto-grading testbed script is provided for you to help evaluate your program. This same testbed script will be used to grade your program. It is pass/fail, so your program must pass the testbed completely for you to receive credit for this assignment. You may run the testbed as many times as you like.
Please note that it is possible to do this assignment without using one of these sorts, but this will not help you understand the concept, and you will not receive credit if you do not follow the instructions.
Helpful commands
testBed cs241/check10a check10a.py
submit check10a.py