Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

DoublyLinkedList newDoublyLinkedList() which should allocate the memory for a ne

ID: 3592907 • Letter: D

Question

DoublyLinkedList newDoublyLinkedList() which should allocate the memory for a new doubly linked list, initialize the variables, and return the address. void freeDoublyLinkedList(DoublyLinkedList list) which should free the linked list (including any nodes currently in the list). NodeDL *allocateNode(Element value) which should allocate memory for a new node, store "value" inside this node, and return the address of the node. void append(DoublyLinkedList list, Element value) which should add a new node (which stores value) to the end of the list. Notice that often one would want to insert into the middle of a linked list, but for this project it suffices to only insert at the end of a linked list. a. b. c. d.

Explanation / Answer

#include #include #include #include //#define constant values #define MAX_URL_LENGTH 50 #define TRUE 1 #define FALSE 0 //typedef for the Element struct which constains a c string to store a URL in the BrowserList typedef struct { char szURL[MAX_URL_LENGTH]; } Element; //Typedef for a node in the doubly linked list (has next and previous pointers). typedef struct NodeDL { Element element; struct NodeDL *pNext; struct NodeDL *pPrev; } NodeDL; //Typedef for a doubly linked list implementation. //Contains a pointer to the first node in the list and the last node in the list (pHead and pFoot respectively). typedef struct { NodeDL *pHead; NodeDL *pFoot; } DoublyLinkedListImp; typedef DoublyLinkedListImp *DoublyLinkedList;
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote