Question: CAN SOMEONE HELP ME WITH THE FUNCTION void sortList() PLEASE? Write in C on Visual Studio. Thumbs up will be given if done correctly. I

CAN SOMEONE HELP ME WITH THE FUNCTION void sortList() PLEASE? Write in C on Visual Studio. Thumbs up will be given if done correctly. I provided multiple images, please look over it!!!!!! THANKS!!!

CAN SOMEONE HELP ME WITH THE FUNCTION void sortList() PLEASE? Write inC on Visual Studio. Thumbs up will be given if done correctly.I provided multiple images, please look over it!!!!!! THANKS!!! sortList: (see displayList()

sortList: (see displayList() photo for unsorted list) urrently 3 patient (s) on the list. Enter your selection: a: add a new patient d: display patient list r: remove a patient from the list s: sort patient list by name q: quit Patient list sorted! Use display option 'd' to view sorted list urrently 3 patient (s) on the list. Enter your selection: a: add a new patient d: display patient list r: remove a patient from the list s: sort patient list by name q: quit Patient name: David Luiz ctor name Steve Rogers ritical level: very critical Room number: 290 Patient name: Eden Hazard ctor name: Tony Stark ritical level: not critical Room number: 101 Patient name: Willian Borges ctor name: Bruce banner ritical level: critical Room number: 155 #define MAX NAMELENGTH 25 - typedef enum very_critical-0, critical, not_critical } criticalType; /I enum type char *criticalLevels] very critical", "critical", "not critical" J; // modified struct patientRecord char patientName [MAX_NAME_LENGTH]; char doctorName [MAX_NAME_LENGTH] criticalType criticalLevel; unsigned int roomNumber; struct patientRecord* next; I/ pointer to next node } *list NULL; // Declare linked list list // forward declaration of functions (already implmented) void flushStdIn(; void executeAction(char); functions that need implementation: int add (char* patientName_input, char* doctorName_input, char* criticallevel_input, unsigned int roomNumber_input); void displayList(); int countNodes (); int deleteNode (char* patientName_input); //10 points void swapNodes (struct patientRecord node1, struct patientRecord* node2); /5 point:s void sortlist(); // 10 points // 5 points // 10 points int main() char selection-i'; printf("nCSE240 HW6 "); // initialized to a dummy value printf(" Currently %d patient(s) on the list.", countNodes()); // NOTE : countNodes() called here printf(" Enter your selection: "); printf("It a: add a new patientIn") printf("It d: display patient list "); printf("t r: remove a patient from the list "); printf("It s: sort patient list by name "); printf("It q: quit "); selection getchar(); flushStdIn(); executeAction(selection); while (selection !- q"); return 0; Activate W /Q6 sortList (10 points) //This function sorts the linked list by alphabetical order of patient name. // Parse the list and compare the patient names to check which one should appear before the other in the list. I7 Sorting should happen within the list. That is, you should not create a new linked list of patients having sorted patients // Hint: One of the string library function can be useful to implement this function because the sorting needs to happen by patient name which is a string. // Use swapNodes() to swap the nodes in the sorting logic void sortlist() struct patientRecord* templist -list; // work on a copy of 'list

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!