Answered step by step
Verified Expert Solution
Question
1 Approved Answer
With the 4 provided structs, create the function BrowserList newBrowserList(), in C. Will thumbs up for a function that would be able to meet the
With the 4 provided structs, create the function BrowserList newBrowserList(), in C.
Will thumbs up for a function that would be able to meet the requirements above!
//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 DoublyLinkedList Imp *DoublyLinkedList; //typedef for the Element struct which constains a c string to store a URL in the Browserlist typedef struct char szURL [MAX_URL_LENGTH]; 1 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 Browserlist Imp which stores a DoublyLinkedList of all of the URLS visited plus a pointer //to the node containing the current webpage. typedef struct DoublyLinkedlist list; NodeDL *pCurrentURL; BrowserListImp: typedef BrowserList Imp *BrowserList; BrowserList newBrowserList() which allocates the memory for a new Browserlist, initializes its variables, and returns its address. //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 DoublyLinkedList Imp *DoublyLinkedList; //typedef for the Element struct which constains a c string to store a URL in the Browserlist typedef struct char szURL [MAX_URL_LENGTH]; 1 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 Browserlist Imp which stores a DoublyLinkedList of all of the URLS visited plus a pointer //to the node containing the current webpage. typedef struct DoublyLinkedlist list; NodeDL *pCurrentURL; BrowserListImp: typedef BrowserList Imp *BrowserList; BrowserList newBrowserList() which allocates the memory for a new Browserlist, initializes its variables, and returns its addressStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started