Question
Given a linked list of the following type: struct planeData{ short flightCode; long xCord; long yCord; double distance; char direction; enum dir flightPattern; enum loc
Given a linked list of the following type:
struct planeData{
short flightCode;
long xCord;
long yCord;
double distance;
char direction;
enum dir flightPattern;
enum loc location;
struct planeData *nextPlane;
};
Write the following functions:
1)
struct planeData* sortByCode (struct planeData*);
Here you are to sort the link list according to the "flight code" field (short flightCode) of the process (descending order). You should return a pointer to the beginning of the link list.
2)
void terminateAndWrite (struct planeData*);
If the user enter this command you are to write all the processes that remain in the list to a file called planeControlLog.txt. Each field of the structure should be written to an individual line. To separate processes write the symbol % to a line. After writing you should you should free the list and terminate the program.
Please let me know if I need to include more information. I think I've included enough but not sure.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started