First page Back Continue Last page Graphics
SO, WHAT'S WRONG?
If all the students were to fail, the execution time for the program would grow proportionally to the square of the number of students. O(n2)
The problem is using the vector to store the items which is optimized for fast random access. The price of this, is that it can be expensive to insert or delete elements other than at the end.