Doubly Linked List


there is an interactive demonstration of a double linked list HERE



Video



copy over all the files provided for you 
the files are in the usual place
then add the complete and functional main.cpp and , SLinkedList.h from the Singly Linked List homework


For this assignment you will create a  Template Doubly Linked List

Run the Example Program to see the Doubly  Linked List in action 

your job is to duplicate the action of the example


use your Singly Linked List as the starting point 
RENAME YOUR FILE  to DLinkedList.h

add a second node pointer (previous) to your DListNode inner class

and a second node pointer (tail) to your DLinkedList class 


using search and replace in vi will help speed up the operation considerably

Esc :     (enter command mode)
%s/SLinkedList/DLinkedList/g

this will replace all instances of SLinkedList with DLinkedList in the file

20,25s/SLinkedList/DLinkedList/g

this will replace all instances of SLinkedList with DLinkedList in lines 20 to 25




for tonight's lab you need to verify that you have a fully functional  Constructor, Destructor, Insert, Insert After  and ToString functions 


Your other functions may not work properly until you update them to include the logic to deal with the additional pointer in the node and the tail pointer.
only very minor changes to your main should be needed


you will need to test by adding values and printing it out, make sure that both the prev and next pointers are set and that they link to the correct nodes
a good test is the viewlist page

test that your destructor cleans up any created nodes.. (your previous SLinkedList destructor should work)

add some logic to the ToString function so it had the value of the next pointer for each node (see example output) 

THE EXAMPLE HAS LOTS OF LOGGING , make sure your logging matches the example to help guide you 
the logging says line by line what the function is doing, use them as instructions on what you need to change

you can use a separate terminal window to monitor a logfile or anyfile that chages in real time with
tail -f filename

I highly suggest you have a separate terminal to monitor the example logfile 





make sure to test by inserting after a value that does not exist
and insert after the last value



YOUR ToString MUST WORK WITH THE WEBSITE  
http://cs.csubak.edu/~msarr/cmps2020/viewlist.php
and show up as double linked list