Question: 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

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!