Write the code that corresponds to the following linked list manipulation diagrams:
Initial: Head -> [ ] -> [ ] -> |
^
|
p n -> [ ]
Step 1 : Head -> [ ] ---> [ ] -> |
/\ /\
| |
p n -> [ ]
Step 2 : Head -> [ ]-----+ [ ] -> |
/\ | /\
| \/ |
p n->[ ]
n->Next = p->Next; p->Next = n;