Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write single linked list class member functions push_front, pop_front and front. The function signatures and the basic modes of operation can be described as follows:
Write single linked list class member functions push_front, pop_front and front. The function signatures and the basic modes of operation can be described as follows:
void push_front(const int &) { insert(0, din); }
void pop_front() { erase(0); }
const int &front() { node *p=findnode(0); return p->data; }
Your job is to implement each of these functions without calling other list member functions. Instead make explicit use of pointers when relinking and accessing the nodes. Submit only the code for these three functions.
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