This lab extends the previous labs 5-7 and must be submitted. (Don't worry - this is the last employee lab :-) )
1) Add a FIRE command to main that will use your findEmployee function you wrote in lab 7 and the release employee that you wrote in lab 6.
You will need to update releaseEmployee to have it remove the employee from the array as well as freeing the storage. It should set the slot to NULL.
Make sure that LIST still works after firing an employee.
2) Define a sort function as below
(You can copy this code directly into your code. You will need to have #include <stdlib.h> near the top of your file. You may need to change the 3 struct Employee to agree with the name you used for your structure.)
Write two comparison functions for use in the sort routine. Each will take two parameters each having the type pointer to pointer to struct Employee and will return an int (-1 for less than, 0 if equal, 1 if greater than).
Each needs to handle the case where one or both pointers is NULL. Try to sort NULLs to the end of the list.
A)compareByName should compare the names of the employees using strcmp.
B)compareBySalary should sort based on the salary of the two employees.
Create a SALARY command that will sort by salary and then display the list and a NAME command that will sort by name and then display the list.Q1) What does the line in the provided sort function do?