Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Use PEZ ® dispensers to demonstrate the push, pop, and peek methods for stacks to provide a clear and accessible illustration of these methods.

Share Use PEZ ® dispensers to demonstrate the push, pop, and peek methods for stacks to provide a clear and accessible illustration of these methods. with FacebookShare Use PEZ ® dispensers to demonstrate the push, pop, and peek methods for stacks to provide a clear and accessible illustration of these methods. with Twitter
  • The following activities demonstrate these three stack methods:
    • The push method is like putting another candy into the dispenser.
    • The pop method is like removing a candy from the dispenser.
    • The peek method is like opening the dispenser but not removing the candy.

More about this tip

Tags

  • AP A
  • Meaningful and Relevant Content
  • Data Structures
External Source
Ria Galanos from the 2010 AP CS Toy Night
Other Tips By
Other Tips By Ria Galanos

Similar tips

Use a number-guessing game that pushes students to use binary search in a fun and interactive activity that allows you to introduce binary sort in a grounded manner.
Explain the “discards qualifiers” error in C++ using the metaphor of a contractor who has signed a contract not to change instance variables, but then attempts to use subcontractor who hasn’t agreed to the same terms or signed the appropriate forms.
Misconception: Students incorrectly assume that Java’s substring method is destructive and wrongly anticipate the original string will change.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College