Question: Using pointers to implement your own vector ADT. In this assignment, you are going to implement your own version of vectors as an ADT to

Using pointers to implement your own vector ADT.

In this assignment, you are going to implement your own version of vectors as an ADT to manage a collection of doubles using dynamic arrays. (Note that vector is implemented as a template, but you are only required to implement it as a class.) Specifically, your Vector_double ADT should include the following member functions:

a default constructor.

the "Big-3": destructor, copy constructor and overloaded assignment operator.

the "capacity" function: Returns the maximum number of doubles that your vector ADT could store.

the "empty" function: Tests if the vector container is empty.

the "insert" function: Inserts an element into the vector at a specified position.

the "pop_back" function: Deletes the element at the end of the vector.

the "push_back" function": Adds an element to the end of the vector.

the "resize" function: Specifies a new size for a vector. The new size can be smaller or larger than the old size.

the "shrink_to_fit" function: Discards excess capacity.

the "size" function" Returns the number of elements stored in the vector.

the overloaded output operator (<<) to print out the elements in a vector.

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 Databases Questions!