1. What is the output, if any, of each of the following C++ statements?
a. cout info will extract and display the value or data strored
in that node.
b. current = current -> link;
coutinfo;
info stored in the node p
...
1. What is the output, if any, of each of the following C++ statements?
a. cout < info;
current is pointing to the current node. current->info will extract and display the value or data strored
in that node.
b. current = current -> link;
cout<info;
Pointer current is assigned the address of the next node in the linked list through current link. And
then the info stored in that node is displayed
c. cout<link->link->info;
info stored in the node present two node infront of the current node is displayed.
d. triail ->link=NULL;
cout << trail -> info;
We are making trail link NULL, now, the node pointed by trail is the last node and then info stored in
that node is displayed.
e. cout<< last ->link -> info;
Error, as last->link will be NULL.
2. What is the value of each of the following relational expressions?
a. current -> link ==temp
the expression will return 1, Otherwise 0
b. temp -> link link -> info ==50
info stored in the node present two node infront of the current node is changed to 50
c. trail ->link -> link ==0
0 signifies NULL. So the next node of the trail node is made the last node of the linked list as its link is
NULL
This study source was downloaded by 100000784424693 from CourseHero.com on 04-17-2021 10:11:34 GMT -05:00
https://www.coursehero.com/file/16846244/assigment-5/
This study resource was
shared via CourseHero.com
d. last ->link == NULL
The node pointed by last is made the tail of the list
e. list = = current
the expression returns 1, Otherwise 0
3. What are the effects, if any, of each of the following C++ statements?
a. trail -> link = Null;
delete last;
trail node now becomes the last node
b. temp ->link = trail;
trail node is made the next node of the node pointed by temp
c. list -> info = 19;
list node's info is assigned or changed to 19
d. current = current -> link;
current -> link = temp ->link;
The next node of the current node is made now made the current node and next node of the temp
node is also made the next node of the current node
[Show More]