Date: Tuesday, March 9, 2010.
Name: ____________________________________________
- Suppose that you have a linked list describing ingredients for
a tasty European soup, e.g., "beans", "potatoes", "beef". The
only problem with this soup is that it is somewhat bland to our El
Draw, step-by-step, how you can add the element "salsa" after "potatoes"
to the given linked list. Assume that we have a pointer p
that points to the element ("potatoes") after which we want to insert
"salsa".
- Write a code that, given a linked list, a pointer pointing to
an element of this list, and a new object, adds this object to the
list right after the given element (to which the pointer points).
You can use the simplest possible implementation of the linked list.