Question
Assume the following type definitions and variable declarations for Questions 49. typedef struct name_node_s { char name[11]; struct name_node_s *restp; } name_node_t; typedef struct {
Assume the following type definitions and variable declarations for Questions 49.
typedef struct name_node_s {
char name[11];
struct name_node_s *restp;
} name_node_t;
typedef struct {
name_node_t *headp;
int size;
} name_list_t;
. . .
{
name_list_t list;
name_node_t *np, *qp;
Write a code fragment that places the words Hello, C, and Language in successive elements of the linked list referenced by structure list. Define list.size accordingly.
Write a code fragment to insert the word Programming between C and Language.
Write a function called delete_last that removes the last element from any list referenced by structure list.
Write a function place_first that places its second parameter value as the first node of the linked list referenced by structure list, which is passed as the functions first argument.
Write a function called copy_list that creates a linked list (the function result) with new nodes that contain the same data as the linked list referenced by the single argument of copy_list.
Write a function that you could call to delete all nodes with name component "Smith" from a linked list referenced by structure list. The linked list and the name to delete are the functions two parameters.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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