Question
I need help with the copy constructor of a linked stack.(in C++) .This this the code for the LStack class: template class LStack { private:
I need help with the copy constructor of a linked stack.(in C++) .This this the code for the LStack class:
template
SingleList
public: LStack(); LStack( LStack const & ); ~LStack();
bool empty() const; int size() const; int list_size() const;
Type top() const;
void swap( LStack & ); LStack &operator=( LStack ); void push( Type const &obj ); Type pop();
// Friends
template
template
//NEED HELP WRITING THIS
}
SingleNode class:
template
public: SingleNode( Type const &e = Type(), SingleNode *n = 0 );
Type retrieve() const; SingleNode *next() const;
friend class SingleList
SingleList class:
template
public: SingleList(); //constructor SingleList( SingleList const & ); //copy constructor ~SingleList(); //destructor
// Accessors
int size() const; bool empty() const;
Type front() const; Type back() const;
SingleNode
int count( Type const & ) const;
// Mutators
void swap( SingleList & ); SingleList &operator=( SingleList const & );
void push_front( Type const & ); void push_back( Type const & );
Type pop_front();
int erase( Type const & );
// Friends
template
Step 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