(Solved):– LINKED LIST — Given the following declarations: class NodeType public: NodeType( int = 0 ); // constructor with default value for info field int info; // data NodeType * nextPtr; // pointer to… View Answer…

 

Question

— LINKED LIST —

Given the following declarations:

class NodeType {

public: NodeType( int = 0 );

// constructor with default value for info field int info; //

data NodeType * nextPtr; // pointer to next node in the list

};

// Constructor

NodeType::NodeType( int data ) {

info = data; nextPtr = 0; // pointer set to NULL

}

//Assume the following are declared in the main

NodeType * head;

NodeType * currentPtr;

int value;

1. Draw pictures showing what happens when the following

Scroll to top