Question: *** Please make sure to use Visual Studio(C++). Thank you.** ListArray Class Description: You will implement your own List ADT, the ListArray class. 4.1. Implement
*** Please make sure to use Visual Studio(C++). Thank you.**
ListArray Class
Description: You will implement your own List ADT, the ListArray class.
4.1. Implement default constructor: List
4.2. Implement copy constructor: List
4.3. Implement operator =: List
4.4. Implement destructor: List
4.5. Implement insert (): void List
4.6. Implement remove (): void List
4.7. Implement replace (): void List
4.8. Implement clear (): void List
4.9. Implement isEmpty():bool List
4.10. Implement isFull(): bool List
4.11. Implement gotoBeginning ():void List
4.12. Implement gotoEnd ():void List
4.13. Implement gotoNext ():void List
4.14. Implement gotoPrior ():void List
4.15. Implement getCursor (): DataType List
4.16. Implement showStructure ():void List
7.1. Implement moveToNth ():void List:: moveToNth (int n ) throw ( logic_error )
7.2. Implement find ():bool List:: find (const DataType &searchDataItem ) throw ( logic_error )
#ifndef LISTARRAY_CPP
#define LISTARRAY_CPP
using namespace std;
#include
#include
#include "ListArray.h"
template < typename DataType >
List
// Creates an empty list. Allocates enough memory for maxNumber
// data items (defaults to defMaxListSize).
{
}
template < typename DataType >
List
// Copy constructor. Creates a deep-copy list copied from
// the provided model object, source.
{
}
template < typename DataType >
List
// Overloaded assignment operator. Resets a list object to contain a
// deep-copy of the provided model object, source.
{
return *this;
}
template < typename DataType >
// Frees the memory used by a list.
List
{
}
template < typename DataType >
void List
throw ( logic_error )
// Inserts newDataItem after the cursor. If the list is empty, then
// newDataItem is inserted as the first (and only) data items in the
// list. In either case, moves the cursor to newDataItem.
{
}
template < typename DataType >
void List
// Removes the data items marked by the cursor from a list. Moves the
// cursor to the next data item item in the list. Assumes that the
// first list data items "follows" the last list data item.
{
}
template < typename DataType >
void List
throw ( logic_error )
// Replaces the item marked by the cursor with newDataItem and
// leaves the cursor at newDataItem.
{
}
template < typename DataType >
void List
// Removes all the data items from a list.
{
}
template < typename DataType >
bool List
// Returns 1 if a list is empty. Otherwise, returns 0.
{
return false;
}
template < typename DataType >
bool List
// Returns 1 if a list is full. Otherwise, returns 0.
{
return false;
}
template < typename DataType >
void List
throw ( logic_error )
// Moves the cursor to the beginning of the list.
{
}
template < typename DataType >
void List
throw ( logic_error )
// Moves the cursor to the end of the list.
{
}
template < typename DataType >
bool List
throw ( logic_error )
// If the cursor is not at the end of a list, then moves the
// cursor to the next item in the list and returns true. Otherwise,
// returns false.
{
return false;
}
template < typename DataType >
bool List
throw ( logic_error )
// If the cursor is not at the beginning of a list, then moves the
// cursor to the preceeding item in the list and returns true.
// Otherwise, returns false.
{
return false;
}
template < typename DataType >
DataType List
throw ( logic_error )
// Returns the item marked by the cursor.
{
DataType t;
return t;
}
#include "show3.cpp"
template < typename DataType >
void List
throw ( logic_error )
// Removes the data item marked by the cursor from a list and
// reinserts it as the nth data item in the list -- where the
// data items are numbered from beginning to end, starting with 0.
// Moves the cursor to the new position of the moved data
// item.
{
}
template < typename DataType >
bool List
throw ( logic_error )
// Searches a list for searchDataItem. Begins the search with the
// data items marked by the cursor. Moves the cursor through the list
// until either searchDataItem is found (returns true) or the end of the
// list is reached (returns false).
{
return false;
}
#endif // ifndef LISTARRAY_CPP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
