Page 1 of 1

4. Suppose you have a C sorted linked list to keep track of students at a university. Each node in the list is a structu

Posted: Thu May 05, 2022 1:22 pm
by answerhappygod
4 Suppose You Have A C Sorted Linked List To Keep Track Of Students At A University Each Node In The List Is A Structu 1
4 Suppose You Have A C Sorted Linked List To Keep Track Of Students At A University Each Node In The List Is A Structu 1 (31.16 KiB) Viewed 43 times
4 Suppose You Have A C Sorted Linked List To Keep Track Of Students At A University Each Node In The List Is A Structu 2
4 Suppose You Have A C Sorted Linked List To Keep Track Of Students At A University Each Node In The List Is A Structu 2 (11.28 KiB) Viewed 43 times
4. Suppose you have a C sorted linked list to keep track of students at a university. Each node in the list is a structure of the form: struct student { char *first_name; char last_name; unsigned int a number; float gpa; struct student *next; The list is sorted in alphabetical order by last_name and then first_name. Assume that last_name and first_name each point to a dynamically-allocated, efficiently-sized string. Your task on the following pages is to write a C function that determines if a student with a specified first name and last_name is in the list. If the student exists, the function returns a pointer to that struct student. Otherwise, the function returns a NULL pointer. Be sure to consider the case where the list is empty. The function prototype is as follows: struct student find_student (struct student *list, char *first_name, char *last_name);
b. [15 pts] Using the above function prototype (including the arguments and the return value) and your pseudocode as references, write a complete find_student function in C. Include appropriate comments. DO NOT write an entire C program, just the find student function.