Question: Complete the Insert() and InsertBack() function of the Chain class. template class Chain; // forward declaration template class ChainNode { friend class Chain ; private:

 Complete the Insert() and InsertBack() function of the Chain class. template

Complete the Insert() and InsertBack() function of the Chain class. template class Chain; // forward declaration template class ChainNode { friend class Chain; private: T data; ChainNode* link; }; template class Chain { public: Chain() {first = 0;} // constructor initializing first to 0 // Chain manipulation operations InsertBack(const T &e); //insert e to the back of the list Insert(const T &e); //insert e to the beginning of the list II... private: ChainNode * first; } template void Chain::InsertBack(const T& e) //insert e to the back of the li: if (first) { // nonempty chain 1 //fill your code here } else first = new ChainNode(e); } template void Chain::Insert(const T& e) //insert e to the begin of the list { if (first) { // nonempty chain //fill your code here else first = new ChainNode(e)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!