Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Print the min, average, max GPAs in the linked list /* * Function: NewStudentCell * Usage: student_cell_T *element; * element = NewStudentCell(int id, double gpa,

Print the min, average, max GPAs in the linked list

/* * Function: NewStudentCell * Usage: student_cell_T *element; * element = NewStudentCell(int id, double gpa, char *name); * -------------------------- * This function allocates space for a student cell and intilize its fileds */ student_cell_T *NewStudentCell(int id, double gpa, char *name) { student_cell_T *element; element = (student_cell_T *) malloc( sizeof(student_cell_T) ); if( !element){ fprintf(stderr,"NewStudentCell cannot allocate memory "); return NULL; } element->id = id; element->gpa = gpa; element->name = name; return element; }

/* * Type: student_cell_T * ----------- * This type defines the cells used for the linked list that * stores the student information we use in assing0 * You can change this structure later on for other assignments! */ typedef struct student_cell_T { int id; double gpa; char *name; // name is just a pointer here, you need to allocate space for name struct student_cell_T *next; } student_cell_T;

/* * Type: linked_list_T * -------------- * This type defines the concrete representation of a linked list of student cells. * The head field points to the first element in the linked list. * The tail field points to the last element in the linked list. * The empty linked list is indicated by a NULL head pointer. */ typedef struct linked_list_T { student_cell_T *head; student_cell_T *tail; } linked_list_T; 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions