Question: Complete the construct_3_strs.c to build the structure in the above drawing. Your implementation must pass the self-contained tests(you do not have to implement it). For

Complete the construct_3_strs.c to build the structure in the above drawing. Your implementation must pass the self-contained tests(you do not have to implement it). For instance, when you run

./construct_3_strs

The self-test should output:

x -> CS232 is awesome

Complete the construct_3_strs.c to build the structure in the above drawing. Your

CS232 awesome CO construct_3_strs.c x 1 #include 2 #include 3 typedef struct node { 4 char * value; //must use dynamic allocation 5 struct node* next; 6 } node_t; 7 8 node_t * construct_3_strs() { 9 return NULL;//just to pass compiler, please edit as needed. 10 } 11 12 //You can ignore the following code for testing 13 int dump_all (node_t*); 14 int main (int argc, char ** argv) { 15 node_t * x = construct_3_strs(); 16 return dump_all(x); 17 18 19 20 int dump_all (node_t * x) { 21 printf("x -> $3", x->value); 22 node_t y = x->next; 23 printf("%s", v->value); 24 node_t * z = y->next; 25 printf("%s ", z->value); 26 if(z->next != x) { 27 printf("failed"); 28 return -1; 29 } else { 30 return 0; 31 } 32 33 HTT

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 Databases Questions!