Question: 1 CMPS 12B Data Structures Assignment 2 The purpose of this assignment is to create the functions needed to perform doubly-linked list operations. The assignment

1 CMPS 12B Data Structures Assignment 2 The purpose of this assignment is to create the functions needed to perform doubly-linked list operations. The assignment will be written in C and you will turn in only the functions required. You will write your own main program to test and validate your linked list functions. In this assignment, write all error messages to stderr instead of stdout. Printf() implicitly writes to standard out. To write to a different file, use the fprintf() function, as shown in this example: if (ptr == NULL) fprintf(stderr, bad input, null pointer not an acceptable input value ); By default both stdout and stderr go to the console. Use the shell redirect operator to send either stderr or stdout to a file. You can test this by executing your program and redirecting output from stderr to a file using the shell. In example (1), the program listTest is invoked and the stderr output is redirected to the file errors, while stdout continues to be sent to the console. Example (2) redirects stdout to the file output, but stderr is still sent to the console. (1) % listTest 2> errors (2) % listTest > output You will create files main.c (for your own use), list.c and list.h. main.c - contains the tests and is the driver for your list function testing listUtil.c - contain the printing and traversal routines to help you debug your code [supplied] listUtil.h - function prototypes for utility functions used by main to test your program [supplied] list.c - contain the list manipulation routines list.h - contains the list node definition and list function prototypes [supplied] You list.h file should contain this exact structure definition and function prototypes: typedef struct NodeObj { int value; struct NodeObj *prev; struct NodeObj *next; } NodeObj; NodeObj *create_new_node(int id); void insert(NodeObj **list_head, NodeObj *to_be_inserted); void ordered_insert(NodeObj **list_head, NodeObj *to_be_inserted); void delete_all(NodeObj *list_head); void delete(NodeObj **list_head, NodeObj *to_be_deleted);

1 CMPS 12B Data Structures Assignment 2 The purpose of this assignment

is to create the functions needed to perform doubly-linked list operations. The

how do you do delete all and ordered insert

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!