Question: Function Description: The empty function returns 1 if Vector is empty and 0 if it is not empty. The push function inserts the value at

Function Description:
The empty function returns 1 if Vector is empty and 0 if it is not empty.
The push function inserts the value at the end of the vector. At this time, for the allocation size of the vector, it is changed according to the number of elements as described.
The pop function deletes the last element of the vector and returns the value. At this time, the assignment size of the vector is changed according to the number of elements as described above. If the vector is empty, return -1.
The front function returns the earliest element of the vector (an element with index 1). If the vector is empty, it returns -1.
The back function returns the last element of the vector. If the vector is empty, it returns -1.
The print all function outputs all elements of the vector. At this time, the 0th index of the vector means the number of vector elements, not elements, so it is excluded. If the vector is empty, it returns -1.
Function Description: The empty function returns

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!