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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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 41 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 41 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply