Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could any one send C++PROGRAM Given an array a={5, 10, 15, 20}, write a C++ code

ID: 3608884 • Letter: C

Question

Could any one send C++PROGRAM

Given an array a={5, 10, 15, 20}, write a C++ code to build alinklist with the values come from array a. Then using therecursive method to print the list in reverse order. Which meansthe 20 will be print out first, and 5 will be print outlast. Could any one send C++PROGRAM

Given an array a={5, 10, 15, 20}, write a C++ code to build alinklist with the values come from array a. Then using therecursive method to print the list in reverse order. Which meansthe 20 will be print out first, and 5 will be print outlast.

Explanation / Answer

//Hope this will help you.. #include using namespace std; struct node{ int n; struct node *next; }*first=NULL,*ptr; void insert(int *arr,int count) { int i; ptr=first; for(i=0;in = arr[i]; first->next=NULL; ptr=first; }else { ptr->next = new struct node; ptr=ptr->next; ptr->n = arr[i]; ptr->next=NULL; } } } void print_list(struct node *ptr){ if(ptr==NULL) return; print_list(ptr->next); cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote