Programming > QUESTIONS & ANSWERS > Houston Community College - COSC 1436assigment 5 (All)
1. What is the output, if any, of each of the following C++ statements? a. cout <<current-> info; current is pointing to the current node. current->info will extract and display the value or data st... rored in that node. b. current = current -> link; cout<<current->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<<temp->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]
Last updated: 2 years ago
Preview 1 out of 7 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Apr 17, 2021
Number of pages
7
Written in
This document has been written for:
Uploaded
Apr 17, 2021
Downloads
0
Views
69
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·