Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Quick note: Please make sure you label all the Parts. Part I ( 50% of grade). Be sure to read through Chapter 2 in your

image text in transcribedimage text in transcribed

Quick note: Please make sure you label all the Parts.

Part I ( 50% of grade). Be sure to read through Chapter 2 in your textbook before starting this part of the assignment. function processes a portion of the array identified by the first and last indexes of the subarray of the subarray to be processes by this call. textbook. your driver program in the same file if you want. Here is a version of the algorithm from the textbook that is worded slightly differently. Note that the array to be processed is called antray. if (anArray has only one entry) return the value of that entry else if (anArray has more than one entry) return the maximum of maxArray (left half of anArray) and maxArray(right half of anArray) follow this algorithm. Note: When you write a value-returning function, it is important that your function always return a value. If you study the code for binarysearch you should see that it always returns a value. textbook. For this program, you can assume that your function will never be called with first > last. If you are familiar with the assert statement, you can use it to handle this error. Part II ( 50%ofgrade) Be sure to read through Chapter 3 of the textbook before you start this part of the assignment. For this part, you will implement a set ADT. A set is like a bag, except that duplicate entries are not allowed in a set. Objectives 1. Practice using arrays inside class objects. 2. Practice implementing an ADT with an interface and class templates. Summary The required changes for the set operations are: count of items in the set incremented by one. If the entry cannot be added for any reason, the operation fails. - Get frequency of operation - Delete this operation. Since duplicate entries are not allowed, the only possible results are zero or one. This information is already provided by the contains operation. - You will provide a default constructor that initializes the set to an empty set (like the bag constructor). - Add a second constructor that has 2 parameters - an array of ItemType elements, and a count of the number of elements in the array. Use the array elements to initialize the set. Requirements 1. Vectors are used in the toVector method of the class, and in the driver program that tests the class. Do not use vectors anywhere else. The main objective of this assignment is to use arrays inside class objects. 2. Do not use any C++ templates from the STL except as noted in Requirement 1. Set Interface interface operations (methods) similar to the documentation in the BagInterface file. Set Implementation using arrays that need to be included in the ArraySet class template. Programming Assignment Deliverables When you have completed and tested parts I and II of the assignment, submit the following files: 1. driver and recursive function for part I 2. your driver for part II 3. SetInterface.h 4. ArraySeth (includes class definition and implementation) Important: Only submit me files that contain C++ code. Do not include executable files, project or make files, object code files, etc

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

More Books

Students also viewed these Databases questions