Given the following function declaration
void insert( NodePtr afterMe, int num);
//PRE: afterMe points to some node in the non-empty list
//POST: A new node containing num is inserted after afterMe.
void insert(NodePtr afterMe, int num)
{
// which of the following function definitions correctly implement this //function?
}
a. afterMe->link = new Node;
afterMe->link->data = num;
afterMe -> link ->link=afterMe->link;
b. NodePtr tmp=new Node;
tmp-> data = num;
afterMe -> link = tmp;
tmp->link = afterMe -> link;
c. NodePtr tmp=new Node;
tmp-> data = num;
tmp->link = afterMe -> link;
afterMe -> link = tmp;
d. NodePtr tmp=new Node;
tmp-> data = num;
afterMe -> link = tmp;
tmp->link = NULL;
c. NodePtr tmp=new Node;
tmp-> data = num;
tmp->link = afterMe -> link;
afterMe -> link = tmp;
You might also like to view...
Answer the following statements true (T) or false (F)
1. If the user does not select any items from the ListBox, the return value of SelectedIndex is 0. 2. Users may add items directly to the list in a ListBox. 3. The label for an object’s entry in the ListBox is determined by that object’s ToString method. 4. Users cannot select multiple items at the same time from a ListBox. 5. Class CheckedListBox derives from class ListBox and contains similar properties.
Use the ________ Wizard with Access to create a direct link between the table or query and the Word document
Fill in the blank(s) with correct word
Which is not true about JPG files?
A) You can save any or all slides in this format. B) They are web-quality images. C) They use a lossless compression. D) They use a lossy format.
The question "What flavor ice cream would you like?," is an example of ____.
A. multiple branching B. parallel branching C. repetitive branching D. binary branching