Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me define this functions in C++. Comments are given as a guide for what goes in the functions. Functions should be exactly defined
Please help me define this functions in C++. Comments are given as a guide for what goes in the functions. Functions should be exactly defined based on the functions. Please use C++.
// If your array hits the point at which it is less than 1/4 fuli, it should cal this function. //It should shrink such that the array is 2x as big as the data. void shrink to_fitO; //Fills the array with count of T value (e.g.,5a would be la, a, a, a, al) // This replaces the current array. void assign(int count, const T *value); //Purpose: Clears the MyVector /Postconditions: current size set to 0, storage size to default. elements are deallocated and data is set to NULL void clear); //Purpose: puts the value x at the end of an MyVector // Parameters: x is value to be added to MyVector // Postconditions: current size is incremented by 1 If max size is reached, the storage array is grown void push_back(const T &x); /Removes the last element of the list void pop_back); // Purpose: puts the value x at the position i in the MyVector // Parameters: x is value to be added to MyVector i is the position to insert x at /Postconditions: current size is incremented by 1 If max size is reached, the storage array is grown) void insert(int i, const T &x) // Purpose: Removes the element at index i in the array //Parameters: i, the index of the element to remove //Postconditions: if the size of the list is greater than //size is decremented by one. /if the size of the list less than 1/4 the max size // the storage array is shrunk void remove(int i); /Returns the size of the actual data stored in the array list // Remember, with indexing at , this is 1 more than the last elements position index int sizeOStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started