How Linked Lists Really Work

Introduction

This animates the program on page 568 or 582 of Horstmann

  1. List staff;
  2. staff.push_back("Cracker, Carl");
  3. staff.push_back("Hacker, Harry");
  4. staff.push_back("Lam, Larry");
  5. staff.push_back("Sandman, Susan");
  6. Iterator pos;
  7. pos = staff.begin();
  8. pos.next();
  9. pos.next();
  10. pos.next();
  11. staff.insert(pos, "Reindeer, Rudolf");
  12. pos = staff.begin();
  13. pos.next();
  14. staff.erase(pos);
  15. Just before print out occurs....