Learn

Let’s take a minute to review what we’ve covered about stacks in this lesson.

Stacks:

  • Contain data nodes
  • Support three main operations
    • Push adds data to the top of the stack
    • Pop removes and provides data from the top of the stack
    • Peek reveals data on the top of the stack
  • Implementations include a linked list or array
  • Can have a limited size
    • Pushing data onto a full stack results in a stack overflow
  • Stacks process data Last In, First Out (LIFO)

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?