Vectors are sequence containers representing arrays that can change in size. The storage of the vector is handled automatically, being expanded and contracted as needed. Vectors usually occupy more space than static arrays, because more memory is allocated to handle future growth. This way a vector does not need to reallocate each time an element is inserted, but only when the additional memory is exhausted.
You need to implement the following functions for the vector of Numbers.
If the value of size is equal to the value of capacity, and you need to change the value of capacity (reallocate memory) when you push_back a new element. The rule of increasing capacity is: new capacity = max(old capacity + 1, old capacity * 3).
The constructor of vector will not create an array (which means size and capacity is 0).
There are six kinds of commands:
Each commands is followed by a new line character ('\n').
For commend "push_back", "pop_back", "reserve", and "resize", the contents of the Vector, which are either "I" or "F", will be printed. For command "size", the size of the vector will be printed; and for "capacity", the capacity of the vector will be printed. Before the termination of the entire program, the contents of the vector will be printed also.