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 45 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);