Question: in C please #include typedef struct _letter { char info; struct _letter *next; } Letter; int main(void) { Letter a, b, c, d, e, f,

in C please

in C please #include typedef struct _letter { char info; struct _letter

#include

typedef struct _letter { char info; struct _letter *next; } Letter;

int main(void) { Letter a, b, c, d, e, f, g, h, i, j, k, l, m;

a.info = 'E'; b.info = 'L'; c.info = 'E'; d.info = 'V'; e.info = 'E'; f.info = 'N'; g.info = 'P'; h.info = 'L'; i.info = 'U'; j.info = 'S'; k.info = 'T'; l.info = 'W'; m.info = 'O';

a.next = &b; b.next = &c; c.next = &d; d.next = &e; e.next = &f; f.next = &g; g.next = &h; h.next = &i; i.next = &j; j.next = &k; k.next = &l; l.next = &m; m.next = NULL;

// Print the word Letter *ptr = &a; while ( ptr != NULL ) { printf("%c", ptr->info); ptr = ptr->next; } printf(" ");

// Relinks the 13 nodes here so that it spells "TWELVEPLUSONE" // YOU CANNOT CHANGE THE "info" FIELD of ANY NODES

// After rearranging, print the new word ptr = &k; while ( ptr != NULL ) { printf("%c", ptr->info); ptr = ptr->next; } printf(" ");

return 0; }

Name this program one.c-You can download the starting one.c from Blackboard. The starting one.c creates a linked list of 13 nodes to represent "ELEVENPLUSTWO". Your job is to relink the 13 nodes in the specified space to form a linked list to represenTWELVEPLUSONE". You can only change the "next" field of these 13 nodes. You can't change the "info" field of any nodes

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!