Date: Tuesday, October 12, 2010.
Name: ____________________________________________
- Suppose that you have a linked list describing things that
you planned to do today: "school" (go to school) and "home" (go home).
Then you recalled that since yesterday
was Columbus Day, a federal holiday, the post office was closed
and you could not send a letter; so, you decided to post this
letter after school.
Draw, step-by-step, how you can add the new element
"letter" to the given linked list. Assume that we have a pointer p
that points to the previous element ("school").
- Write a code that, given a linked list, a new element, and
a pointer pointing to
a place on this list, adds the given element after
the given place on the list.
You can use the simplest possible implementation of the linked list.