Question: C programming 3. (8 pts) For this problem, you are to complete code that uses a struct to represent a linked list. Provide the missing

C programming

C programming 3. (8 pts) For this problem, you are to complete

3. (8 pts) For this problem, you are to complete code that uses a struct to represent a linked list. Provide the missing code at locations (a), (b), and (c) below. typedef struct Node { int number; struct Node * next; } nodet; //create nodet to hold number; insert nodet at end of list nodet * insert(int number, nodet list) { nodet * newNode = (nodeT *) malloc(sizeof(nodeT)); // create nodet newNode->number = number; newNode->next = NULL; noder * ptr - list; if (list == NULL) { //(a) provide code to handle list being empty } else { //list is not empty 1/(b) provide code to add node at the end of the list } //list value may have been modified so return it return list; } 1/print out list (see use of std::cout on first page) void print (nodet . list) { nodet * ptr - list; //(c) provide code to output each value in the list, one per line }

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!