Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ex. 3.8: Please add to linkedlistExample.c and include a complete printList() function, and fill in a complete memory diagram right after the three nodes are

Ex. 3.8: Please add to linkedlistExample.c and include a complete printList() function, and fill in a complete memory diagram right after the three nodes are added to the list

image text in transcribed

struct person char *name int age; struct person* next; // We've added a "next" pointer struct person *front NULL, *rear NULL; // The usual front,rear pointers void print (struct person *p) printf C" Name-s age-d ", p->name, p->age); struct person* makeNode (char* name, int age) struct person *p; p (struct person*) malloc (sizeof(struct person)); p-name name p->age = age; p->next NULL; return p; void addToList (char* name, int age) if (front-NULL) { front -makeNode (name, age); rear = front else rear->next = makeNode (name, rear -rear->next age); void printList O struct person *p WRITE YOUR CODE HERE use the pointer p //to walk down the list. int main O addToList ("R2-D2", 609); addToList ("Optimus Prime", 2700); addToList ("Wall-E", 210); printList O; Exercise 3.8: Copyl/paste the above in linkedlistExample.c, including a complete printList() function, and fill in a complete memory diagram right after the three nodes are added to the ist (only include heap addresses - use the debugger to find them)

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago