Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that uses a pointer-based linked list. You should use the following struct (declared as a global): struct node {char name [42]; struct

image text in transcribed

Write a program that uses a pointer-based linked list. You should use the following struct (declared as a global): struct node {char name [42]; struct node r next;} Note that no other variables can be global. To populate your linked list, open the hw7.data file and read in the contents. the file format is as follows: name op code for example: a Cullen a Mortician a Ophelia a Smurf a Mortician d the name will be a string. the will be a character ('a' or 'd'), where 'a' indicates that you should add this person to the linked-list, 'd' indicates that you should delete this person from the linked-list. Note that when you add a person you must add them in increasing order. i.e. we are adding them as an insertion sort (no, you cannot presort the list). This MUST be separate functions (adding and deleting). You also need to provide output that proves your program works. After the last data item has beer, processed, your program. must display the contents of the linked-list. This MUST be a separate function. Your program must also correctly free all links of the list on termination. This MOST be a separate function. Instead of creating a single link linked-list, create a doubly linked list. Populate the list accordingly and display the contents of the list from both directions (you must clearly state which display is which). Also, note in your email, that you did the extra credit. the extra credit grading is atomic - it either works (+10 points) or it doesn't (0 points). Beverly a Kathy a l a Gary a Chuck a David a Kari a Tom a Scott a Beverly d Brenda d Kathy a Cary a When Chen a Chuck a Mike a Emanuel a Linda a Bernie a Hassan a Brian a Gary d Kathy d Gary a a Kathy a Brenda a Jury. a Peanut a Travis a

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions