Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This code is longer, but safer, more robust and more extensible.

But Wait, There's More!

How could you extend the delegation ideas in the above technique to enable you to differentiate between the follow four scenarios involving two lists?

  1. One list is empty and
    1. the other list is empty or
    2. the other list is non-empty
  2. One list is non-empty and
    1. the other list is empty or
    2. the other list is non-empty