03-链表

type
status
date
slug
summary
tags
category
icon
password

1️⃣ 单向链表

notion image

2️⃣ 双向链表

notion image

3️⃣ 循环链表

notion image
notion image
循环链表(Circular Linked List)是一种特殊的链表结构,其特点是:
链表的尾节点指向头节点,形成一个环状结构。
这类结构常用于 环形缓存、任务轮询调度器、约瑟夫问题(Josephus) 等应用中。

4️⃣ 带头节点链表(也称带哨兵节点链表

带头节点链表在链表最前面添加一个不存放有效数据的节点,称为头节点(dummy head)或哨兵节点(sentinel node)
notion image
带头节点链表常用于
  • 链表合并
  • 链表分段处理(如反转 k 个一组)
  • LRU 缓存实现中的双向链表
  • 链表构建模板(避免返回空 head)
 
上一篇
02-数组
下一篇
04-栈
Loading...