Type in C++ programming!!
Topics: Recursive Structs, Pointers and Memory Management in C.
For this assignment, you will add to your multi-file C program (Program 04) to define, implement and use a third kind of dynamic linked list. Please refer to Lab 04 for the definition of a basic dynamic linked list.
In this assignment you will need to use the basic ideas of a node and of a linked list (of nodes) to implement two more functions which can be used to create and maintain a new kind of list.
Inorder:
- A list where adds and removes occur such that the list is always in (ascending) sorted order
Requirements:
- You must add to your lists.c - given the following lists.h (which can not be modified):
// a recursive data type definition
// serves as the nodes of a list
typedef struct node
{
int id;
char* name;
struct node* next;
} node;
// create an empty list - set *node = NULL
void create_list(node** head);
// add a new node to the front of the list
void add_front(node* *head, node* new_node);
// add a new node to the end of the list
void add_end(node* *head, node* new_node);
// add a new node in the list, in (ascending) sorted order based on
// the nodes name component's value
void add_inorder(node* *head, node* new_node);
// remove and return the first node in the list whose name component's value
// is equal to the given key_name
// return NULL if no such node exists in the list
node* rem_inorder(node* *head, char* key_name);
// remove and return the node at the front of the list or NULL if empty
node* rem_front(node* *head);
// remove and return the node at the end of the list or NULL if empty
node* rem_end(node* *head);
// return the number of nodes in the list
int list_len(const node* head);
// print the data values of all the nodes in the list (from start to end)
void print_list(const node* head);
// free the entire list and set *node = NULL
void free_list(node* *head);
- You must add to your main.c so that it tests your Inorder list implementation completely
- You should not need to modify your Makefile
Topics: Recursive Structs, Pointers and Memory Management in C. For this assignment, you will add to your multi-file C program (Program 04) to define, implement and use a third kind of dynamic linked list. Please refer to Lab 04 for the definition of a basic dynamic linked list. In this assignment you will need to use the basic ideas of a node and of a linked list (of nodes) to implement two more functions which can be used to create and maintain a new kind of list. Inorder: 1. A list where adds and removes occur such that the list is always in (ascending) sorted order Requirements: . You must add to your lists.c- given the following lists.h (which can not be modified): // a recursive data type definition // serves as the nodes of a list typedef struct node int id; char* name; struct node* next; } node; // create an empty list - set *node = NULL void create_list (node** head); // add a new node to the front of the list void add_front (node* *head, node* new_node); // add a new node to the end of the list void add_end (node* *head, node* new_node): || // add a new node in the list, in (ascending) sorted order based on // the nodes name component's value void add_inorder (node* *head, node* new_node); 11 remove and return the first node in the list whose name component's value // is equal to the given key_name // return NULL if no such node exists in the list node* rem_inorder (node* *head, chart key_name); // remove and return the node at the front of the list or NULL if empty node* rem_front (node* *head); // remove and return the node at the end of the list or NULL if empty node* rem_end (node* *head); // return the number of nodes in the list int list_len (const node* head); // print the data values of all the nodes in the list (from start to end) void print_list (const node* head); // free the entire list and set *node = NULL void free_list (node* *head); You must add to your main.c so that it tests your Inorder list implementation completely You should not need to modify your Makefile . Topics: Recursive Structs, Pointers and Memory Management in C. For this assignment, you will add to your multi-file C program (Program 04) to define, implement and use a third kind of dynamic linked list. Please refer to Lab 04 for the definition of a basic dynamic linked list. In this assignment you will need to use the basic ideas of a node and of a linked list (of nodes) to implement two more functions which can be used to create and maintain a new kind of list. Inorder: 1. A list where adds and removes occur such that the list is always in (ascending) sorted order Requirements: . You must add to your lists.c- given the following lists.h (which can not be modified): // a recursive data type definition // serves as the nodes of a list typedef struct node int id; char* name; struct node* next; } node; // create an empty list - set *node = NULL void create_list (node** head); // add a new node to the front of the list void add_front (node* *head, node* new_node); // add a new node to the end of the list void add_end (node* *head, node* new_node): || // add a new node in the list, in (ascending) sorted order based on // the nodes name component's value void add_inorder (node* *head, node* new_node); 11 remove and return the first node in the list whose name component's value // is equal to the given key_name // return NULL if no such node exists in the list node* rem_inorder (node* *head, chart key_name); // remove and return the node at the front of the list or NULL if empty node* rem_front (node* *head); // remove and return the node at the end of the list or NULL if empty node* rem_end (node* *head); // return the number of nodes in the list int list_len (const node* head); // print the data values of all the nodes in the list (from start to end) void print_list (const node* head); // free the entire list and set *node = NULL void free_list (node* *head); You must add to your main.c so that it tests your Inorder list implementation completely You should not need to modify your Makefile