Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help writing an NodeList class using linked lists in c++? I am supposed to make an NodeList class which is an array made up of

Help writing an NodeList class using linked lists in c++?

I am supposed to make an NodeList class which is an array made up of class DataTypes. We were given the DataType.cpp, DataType.h, and NodeList.h files. (Files given here - https://docs.google.com/document/d/1F4AZfHKEqNbfDYhSGaMmQNWfZFV_Wz92ir9mnlUuu3U/edit?usp=sharing). Now I need to make NodeList.cpp.

A description of all the functions are given down below.

image text in transcribedimage text in transcribedimage text in transcribed

The NodeList Class will contain the following private data members: m_head, a Node class type Pointer, pointing to the Dynamically Allocated Node object considered as the first element of the list. Note. If the list is empty m_head should be NULL and will have the following public member functions: (1) Default Constructor will instantiate a new list object with no data (no Nodes). Note. What needs to be initialized in this case? (2) Parametrized Constructor - will instantiate a new list object, which will hold size_t count number of elements (Nodes) in total, all of them initialized to hold the same value as the DataType value parameter. Note: Has to properly handle allocation. (3) Copy Constructor _ will instantiate a new list object which will be a separate copy of the data of the other NodeList object which is getting copied. Note. Remember Deep and The NodeList Class will contain the following private data members: m_head, a Node class type Pointer, pointing to the Dynamically Allocated Node object considered as the first element of the list. Note. If the list is empty m_head should be NULL and will have the following public member functions: (1) Default Constructor will instantiate a new list object with no data (no Nodes). Note. What needs to be initialized in this case? (2) Parametrized Constructor - will instantiate a new list object, which will hold size_t count number of elements (Nodes) in total, all of them initialized to hold the same value as the DataType value parameter. Note: Has to properly handle allocation. (3) Copy Constructor _ will instantiate a new list object which will be a separate copy of the data of the other NodeList object which is getting copied. Note. Remember Deep and

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago