7. 理论讲解:堆栈、队列(Stack、Queue)

  1. Stack - First In First Out (FIFO)
    • Array or Linked List
  2. Queue - First In Last Out (FILO)
    • Array or Linked List

1. Stack

入栈与出栈

2. Queue

练习题目

  1. https://leetcode.com/problems/backspace-string-compare/description/
  2. https://leetcode.com/problems/implement-queue-using-stacks/solution/
  3. https://leetcode.com/problems/implement-stack-using-queues/description/
  4. https://leetcode.com/problems/valid-parentheses/description/

你可能感兴趣的:(7. 理论讲解:堆栈、队列(Stack、Queue))