Question: For this assignment, you will use a given selection sort algorithm to implement a sorting program in C . This assignment will be graded out

For this assignment, you will use a given selection sort algorithm to implement a sorting program
in C.
This assignment will be graded out of 10 and worth 5% of your total marks for this course.
Due date:
Please check the SLATE drop box. Late assignments will be penalized according to the class
plan.
Submission requirements:
1. Only upload the C source file to the drop box. (10% will be deducted if any violation)
2. The C source file name should be sortAscending.c (10% will be deducted if any
violation)
3. You must use the given algorithm for implementation. Any work that is not original and
does not follow the given algorithm will result in a grade of zero for this assignment.
4. Your program must contain four functions
1. printArray();
2. sortAscending();
3. findSmallest();
4. swap();
*You are free to design the function prototypes of these four functions.
Marking Scheme:
Function Mark
swap()10%
printArray()20%
sortAscending()30%
findSmallest()40%
Recursion version max score 100%
Non recursion version max score 60%
sortAscending algorithm
1. Place the marker at the first element
2. If the marker is pointing at the last element, then stop. Otherwise continue
3. Find the smallest element to the right of the marker
4. If this element is smaller than the element the marker is pointing at, then swap
5. Advance the marker to the element to the right
6. Go to step 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!