Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Why is background investigation important to the selection process?

Answered: 1 week ago

Question

Many different people can conduct performance appraisals.

Answered: 1 week ago