Write a program to copy the content of the following array to a dynamic single linked list, and write a function to delete every node has an even value in its data ?
1
Expert's answer
2012-07-26T08:50:18-0400
struct node{ int value; struct node* next; }; node* root = new node;
void toList(int* array, int size){ root->value = array[0]; root->next = NULL; node* temp = root; for(int i = 1; i < size; i++){ node* n = new node; n->next = NULL; n->value = array[i]; temp->next = n; temp = n; } }
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment