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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!