Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3-5 Consider the following partial node class definition, with member functions called data and link, for questions 3-5. class node public: int data() return data_field;
3-5
Consider the following partial node class definition, with member functions called data and link, for questions 3-5. class node public: int data() return data_field; node* link( ) return link_field; private: int data_field; node* link_field; 3. Suppose we are using the node class definition listed above. Your program is using a node* variable called head_ptr to point to the first node of a linked list (or head_ptr == NULL for the empty list). Write a few lines of C++ code that will print all the integers in the list. 4. Suppose cursor points to a node in a linked list (using the node definition above). What statement changes cursor so that it points to the next node? A. cursor++; B. cursor = link(); C. cursor += link(); D. cursor = cursor->link(); 5. Suppose cursor points to a node in a linked list (using the node above). What Boolean expression will be true when cursor points to the tail node of the list? A. cursor == NULL; B. cursor->link() == NULL; C. cursor->data() == NULL; D. cursor->data() == 0.0; E. None of the aboveStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started