Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Create a minimize member function for a dynamic sequence container that is implemented using an array. Member variables include the array itself, the size

1) Create a minimize member function for a dynamic sequence container that is implemented using an array. Member variables include the array itself, the size of the array and the current number of items stored in the array. The function should insure that there is no dynamic memory being wasted by empty array elements.

2) Write a function implementation that overloads the == operator of a dynamic sequence container class to test if two object have the same data sets.

3) Write a function implementation that overloads the == operator of a sequence3 container class to test if two object have the same data sets.

4) Write efficient member functions for the following operations (include documentation): a) delete the first element from a dynamic array. b) delete the last element from a dynamic array.

5) Implement the following function. Make sure you have no memory leaks.

size_t reduceEven(double*& olda, const size_t& size)

Precondition: olda is a dynamic array

Postcondition: The array at olda is replaced with a new array that contains ONLY the EVEN indexed values in its most minimal usage of memory. For example, index's 0,2,4, and so on will exist in the new array and 1 and 3 will be discarded. The new array will be about half the size of original. The number of items removed from the array is returned.

6. Implement the following function. Make sure you have no memory leaks.

void append(node*& headptr, const string& s)

Precondition: headptr points to a singularly linked list of nodes where value_type is string.

Postcondition: appends a copy of the string passed as a parameter, into the back of the list

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

Step: 3

blur-text-image

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago