10. 理论讲解:优先队列

1. 回忆

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

2. 本次内容

  1. Stack - First In Last Out (FILO)
    • Array or Linked List
  2. Queue - First In First Out (FIFO)
    • Array or Linked List
  3. PriorityQueue - 优先队列
    • 正常入、按照优先级出

3. Heap (Binary, Binomial, Fibonacci)

3.1 Mini Heap

10. 理论讲解:优先队列_第1张图片

3.2 Max Heap

10. 理论讲解:优先队列_第2张图片
image.png

4. Heap Wiki

• https://en.wikipedia.org/wiki/Heap_(data_structure)
• Google 搜索 heap 或者 堆

10. 理论讲解:优先队列_第3张图片

5. 练习题目

  1. https://leetcode.com/problems/kth-largest-element-in-a-stream/discuss/149050/Java-Priority-Queue
  2. https://leetcode.com/problems/top-k-frequent-words/description/

你可能感兴趣的:(10. 理论讲解:优先队列)