Show what is produced by the following C++ code. Assume the node is in the usual info-link form with the info of type int. (list and ptr are pointers of type nodeType.)
a.
list = new nodeType;list->info = 10;ptr = new nodeType;ptr->info = 13;ptr->link = NULL;list->link = ptr;ptr = new nodeType;ptr->info = 18;ptr->link = list->link;list->link = ptr;cout ≪ list->info ≪ " " ≪ ptr->info ≪ " ";ptr = ptr->link;cout ≪ ptr->info ≪ end1;
b.
list = new nodeType;list->info = 20;ptr = new nodeType;ptr->info = 28;ptr->link = NULL;list->link = ptr;ptr = new nodeType;ptr->info = 30;ptr->link = list;list = ptr;ptr = new nodeType;ptr->info = 42;ptr->link = list->link;list->link = ptr;ptr = List;while (ptr != NULL){cout ≪ ptr->info ≪ end1; ptr = ptr->link;}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.