Question: Answer in C Programming Language only. Consider the following struct: struct student i shar firstname [100 /*a string less than 100 characters long */ char

Answer in C Programming Language only.

Consider the following struct:

Answer in C Programming Language only. Consider the following struct: struct student

struct student i shar firstname [100 /*a string less than 100 characters long */ char middle; shar lastname[100]; double gpa; /* grade point average */ ;/*positive numbers only* Implement a sorting algorithm that accepts a special key as input that identifies which kind of sort to perform Key Value Kind of Sort Alphabetical order (a-z) by lastname, if lastnames are equal then by firstname (a-z) If firstnames are equal, then by middle initial You may use strcmp to perform the ordering By gpa, largest to smallest, if equal, then by credit hours taken By credit hours, smallest to largest Otherwise The list remains the same You may not implement 3 different sorting algorithms. You must implement one sorting algorithm that chooses a comparison operation based upon the value of the key variable. Use the following prototype typedef struct student Item; zeid sort (Item a[], int size, int key); Hint: Implement an additional function to perform the LESS operation, and pass it two pointers to each struct player you're comparing and the key value

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!