Given the following linked list structure in C: typedef struct node_t { char *da
ID: 657354 • Letter: G
Question
Given the following linked list structure in C:
typedef struct node_t
{
char *data;
struct node_t *next;
} node_t;
Implement methods to insert a node at the end of the list, remove a node from the end of the list, and search for a node containing a specific string. Use the following prototypes:
void insert_node(char *data, node_t *head);
void delete_node(node_t *head);
int find_node(char *search, node_t *head);
Note that find_node() should return -1 if the specified string was not found in the list. Otherwise, it should return the position in the list at which the node was found.
Explanation / Answer
int find_node(char *search, node_t *head)
{
int count=0;
while (head != NULL)
count++;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.