Question: The following recursive function inserts a value as the last item in a linked implementation of a list. Read the following code and determine what

The following recursive function inserts a value as the last item in a linked implementation of a list. Read the following code and determine what goes in blank #4.

void Insert(NodeType*& listNode, ValueType value)

// Pre: listNode is defined.

// listNode is a pointer to a list.

// Post:value is inserted in a node, which is placed at the end of the list

{

if (listNode == ________) // 1

{

listNode = _______ NodeType; // 2

____________ = value; // 3

____________ = NULL; // 4

}

else Insert(___________, value); // 5

}

[1] listNode->next

[2] listNode->info

[3] value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!