Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 sizeO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

When should you avoid using exhaust brake select all that apply

Answered: 1 week ago

Question

Assess three steps in the selection process.

Answered: 1 week ago

Question

Identify the steps in job analysis.

Answered: 1 week ago