Why do we need two vectors in the vector implementation? What is the role of the other vector?


#1

Why do we need two vectors in the vector implementation? What is the role of the other vector?

If it is storing minimum value then can’t we use just an int?


#2

That vector is used to keep track of the minimum element at every instance. For eg. the i’th element in that vector gives us the minimum value until i’th iteration.