# Stacks

# Stacks

# Theory

  • Abstract Data Type
  • LIFO (Last in, First out)
  • push adds an item as the top item on the stack
  • pop removes the top item on the stack
  • peek gets the top item on the stack without popping it
  • Ideal backing Data Structure: Linked List

If you know the Maximum Number of items that will ever be on the stack, an array can be a good choice. If memory is tight, an array might be a good choice.

# Implementation (Array)

# Implementation (Linked List)

# [Challenge] Stacks

# Question

# Solution

Last Updated: 12/15/2020, 10:27:30 PM