Coding interview 的 Linked List cheatsheet

Linked List 学习指南,包含练习题、技巧、时间复杂度与推荐资源

Introduction

和 array 一样,linked list 用于表示序列数据。不同的是,linked list 的顺序不由内存中物理位置决定,而是通过节点的指针相连。每个 node 包含 data 和 next 指针(指向下一个 node)。

Advantages

在已知位置时,插入/删除节点是 O(1),而数组需要移动后续元素。