Question

Question 2:

Given a singly linked list of n nodes where each node represents a student's profile with the

following data:

Student1 ID

Student1 Name

Student1 GPA

Student2 ID

Student2 Name

Student2 GPA

(Hint: (3.4 +2.7)/2)

Student n ID

Student n Name

Student n GPA

1. [30 points] Write a C function to count the number of students with GPAs greater than

or equal to 2.5 and to calculate the average of their GPAs. Consider all special cases.

Example:

Input: Student 1: GPA 3.4, Student 2: GPA 1.9, Student 3: GPA 2.7

Output: 2 Students with GPAs greater than 2.5. The average of GPAs is: 3.05

2. [20 points] Find the running time T(n) and the corresponding Big O notation for the function

developed in part 1. Justify your answer and show all the details.

Question image 1