Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions