Circularly Linked List Queue Copy Constructor help I am having a hard time figur
ID: 650152 • Letter: C
Question
Circularly Linked List Queue Copy Constructor help
I am having a hard time figuring out how to implement the copy constructor for a linked list based queue. I have worked with creating a linked list stack based data structure but it did not include a copy constructor or copy assignment like this one needs.
This is my header file:
----------------------------------------------------------------------------------------------------------------------------------------
his is how my default constructor looks right now, not sure if it's right though:
-----------------------------------------------------------------------------------------------------------------------
This is how it's supposed to be implemented but where I am lost on how to actually implement. please help:
Explanation / Answer
template <typename T>
LinkedQueue<T>::LinkedQueue(const LinkedQueue<T>& q) : Head(Null)
We have to give Head as Null in copy constructor because without this it will error.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.