Dynamic Linked Lists in C (please read the code overview&design carefully) Write
ID: 3562365 • Letter: D
Question
Dynamic Linked Lists in C (please read the code overview&design carefully)
Write a function insertAtEnd() for a linked list that has the following declaration:
void insertAtEnd (struct node **pStart, int myData);
The function should insert a new node, at the end of the linked list, with the data value myData. Assume that struct node is defined as follows:
struct node
{
int data;
struct node *pNext;
};
You may also assume that the function
struct node *makeNode(int myData)
has already been defined. Recall that makeNode() allocates a node dynamically and sets the node
Explanation / Answer
void insertAtEnd (struct node **pStart, int myData)
{
struct node *temp,**q;
//assumed this allocates a node dynamically and sets the node
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.