Continuing Programming Project 19.4, write a function that separates the students in the vector of StudentInfo records into two vectors, one containing records of passing students and one containing records of failing students. (Use a grade of 60 or better for passing.)
You are asked to do this in two ways, and to give some run-time estimates.
a. Consider continuing to use a vector. You could generate a second vector of passing students and a third vector of failing students. This keeps duplicate records for at least some of the time, so do not do it that way. You could create a vector of failing students and a test-for-failing function. Then you push_back failing student records, then erase (which is a member function) the failing student records from the original vector. Write the program this way.
b. Consider the efficiency of this solution. You are potentially erasing O(N) members from the middle of a vector. You have to move a lot of members in this case. Erase from the middle of a vector is an O(N) operation. Give a big-O estimate of the running time for this program.
c. If you used a list
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.