Answered step by step
Verified Expert Solution
Link Copied!

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;

image text in transcribed

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 above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions