Give code and the drawing to make clear what you are doing.

Here is a diagram of a three node linked list with a head pointer and a node to be inserted. Show all steps necessary to delete the second node, pointed to by discard_me. You may assume the necessary search for the node to be deleted is done and the pointer discard_me is already positioned.

You are to make clear the sequence of steps by either numbering the steps, or by making several copies of this drawing, with one change per drawing, numbered to show the sequence.

You may assume that a search routine taking a head pointer and data arguments has been defined for you.

```

NodePtr discard_me;

NodePtr temp_ptr;

```






Code:

```

NodePtr discard_me;

NodePtr temp_ptr;

discard_me = search( head, discard_data);

head->link = discard_me->link;

delete discard_me

```

Computer Science & Information Technology

You might also like to view...

Which of the following statements is false?

a. Each class can define a constructor for custom object initialization. b. A constructor is a special member function that must have the same name as the class. c. C++ requires a constructor call for every object that’s created. d. A constructor cannot specify parameters.

Computer Science & Information Technology

All revisions in a Word document fall into one of two categories: ________ and deletions

Fill in the blank(s) with correct word

Computer Science & Information Technology

Scope determines the region of a program in which a defined object is visible.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

To modify the leading of selected text, use the ____ panel.

A. Character B. Paragraph C. Paragraph Styles D. Character Styles

Computer Science & Information Technology