Answered step by step
Verified Expert Solution
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.
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 andStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started