
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
C++

Transcribed Image Text:Write the definition of the class template ArrayListType, and the derived class unordered
ArrayListType. Provide implementations for the non abstract functions in the base template class, and
implementations of the template functions in the derived template class. Write a test program to test
the functions in the derived template class. Instantiate objects of type derived class in your test
program using template parameters of type float, int.
You may use the example provided in the lecture slides. Many of the functions were implemented in
the slides. Some were not implemented and you will have to implement them yourself in this lab.
Below are the definitions of the base template class and the derived template class (from the lecture
slides).
template <class elemType>
class arrayListType
{
public:
const arrayListType<elemType> &
operator= (const arrayListType<elemType> &);
//Overloads the assignment operator
bool isEmpty () const;
bool isFull () const;
int listSize () const;
int maxListSize () const;
void print() const;
bool isItemAtEqual (int location, const elemType& item) const;
virtual void insertAt (int location, const elemType& insertItem)
virtual void insertEnd (const elemType& insertItem) = 0;
void removeAt (int location);
void retrieveAt (int location, elemType& retItem) const;
= 0;
virtual void replaceAt (int location, const elemType& repItem)
void clearList();
0;
%3D
virtual int seqSearch (const elemType& searchItem) const = 0;
virtual void remove (const elemType& removeItem) = 0;
arrayListType (int size = 100);
arrayListType (const arrayListType<elemType>& otherList);
virtual ~arrayListType ();

Transcribed Image Text:protected:
elemType *list; //array to hold the list elements
int length;
int maxSize;
//variable to store the length of the list
//variable to store the maximum
//size of the list
};
class unorderedArrayListType
template <class elemType>
class unorderedArrayListType: public arrayListType<elemType>
public:
void insertAt(int location, const elemType& insertItem);
void insertEnd (const elemType& insertItem);
void replaceAt (int location, const elemType& repItem);
int seqSearch(const elemType& searchItem) const;
void remove (const elemType& removeItem);
unorderedArrayListType (int size = 100);
//Constructor
};
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 3 images

Knowledge Booster
Similar questions
- IN THE C PROGRAMMING LANGUAGE j = 15; k = 9 // what are the values for n,m,and p after these operations: --j ; k++ ; n = j - ++k; m = j-- + k--; p = k + j;arrow_forwardEvaluate the following arithmetic expression as the C++ system would evaluate it. 12 /4 3 * 2arrow_forwardExercise 3: ● Comments in C++ are written with special characters. Insert the missing parts: How to Make this a single-line comment And Make this a multi-line comment SME Exarcica A:arrow_forward
- C program, similar question from the book C how to program eighth edition question 4.14 but the problem add the -1arrow_forwardQ2:C has many statements for decisions and loops, while MIPS has few. What are the pros and cons for having more or less decision/loop statements? Please give several detailed examples.arrow_forwardCreate a code in C ++ whose function is to convert a decimal number to an octal onearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY