Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in c++ programming language Q #1. Apply concepts of Advanced Data Structures to implement a template class for array based list with following attributes

image text in transcribedwrite in c++ programming language

Q #1. Apply concepts of Advanced Data Structures to implement a template class for array based list with following attributes and functionalities: template class ABlist private: int max_size; int actual_size; T* list array: public: ABList(int size): -ABList(); int getLength(); T getItem(int); void insertItem (I value); int findAndRemove Item(T); void displayList(); void Mergelist (ABlist); void Reduceto Half(); Constructor will dynamically allocate the list of size 'Size'. insertItem() function will insert new item at the end of the list, only if item is not present in the list already. If item is already present, it will display a message, Item already in the list. FindAndRemoveItem() will search an item in the list, if found, item will be removed from the list. If item is not found, function will return -1. Reduceto Half() will reduce the size of the List to half and copy all the items from the old list to the new list and destroy the old list. MergeLists() will combine two array based lists into one. In main(), define two array based lists of type String and size 10. Ask user to enter 5 names in each of the lists. Merge both the lists and display the resultant merged list on the screen

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

What is the purpose of a code of conduct ?

Answered: 1 week ago