Data Structures C Circular Double Linked List 2 Codes Add Head Add Tail Circular Double Li Q37148277

Data Structures with C++: Circular Double linked listHere there are 2 codes of Add to Head and Add to Tail in acircular double linked list. I need an explanation line by line ofwhat the two different codes do.
void circDLList<T>:addToHead(T val) if (head !=0){ //Not an empty list IntDLLNode<T> *tmp; tmp=new IntDLLNode«T>(head-agetPrevoid circDLList<T>:addToTail(T val)X if (head!=0){ //Not an empty list IntDLLNode<T> *tmp; tmp=new IntDLLNode«T>(head->getPrevoid circDLList<T>:addToHead(T val) if (head !=0){ //Not an empty list IntDLLNode<T> *tmp; tmp=new IntDLLNode«T>(head-agetPrev(), val, head); head->getPrev()->setNext(tmp); head->setPrev(tmp); head-tmp;) IAn empty list cout<<“Empty list”くくendl; head = new IntDLLNode<T>(0, val, 0); head->setPrev(head); head->setNext(head);

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.