Question: Please explain. left (b) (4-marks] Now suppose we implement the deque as a doubly-linked list with no dummy nodes. right D7.09.0 .8 .19 16 prev
Please explain.
![Please explain. left (b) (4-marks] Now suppose we implement the deque as](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66ef994814ff6_37566ef99478bdd9.jpg)
left (b) (4-marks] Now suppose we implement the deque as a doubly-linked list with no dummy nodes. right "D7.09.0 .8 .19 16 prev next Add two lines to complete the following code to reverse the contents of the deque. right left prev next You may use the function swap which only swaps two Node pointers (which are passed by reference). struct Node { string data; Node *prev, *next; }; void DLL::reverse() { Node *p=left; while( p != NULL ) { swap(p->next,p->prev); p=p->prev; swap(left,right)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
