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
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
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
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);
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!