終於來到了 data structure 的部分,看來這系列一定會超過30天了XD
A linked list is a linear data structure that consist with series of nodes connected by pointers(Array is another common linear data structure).
linked list 是線性資料結構的一種,由數個 node 構成,利用 node 中的 pointer 指標來指向下一個node
另外 array 是另種常見的線性資料結構
--
--
Array | Linked List | |
---|---|---|
Accessing Elements | O(1) | O(n) |
Insert & Remove from the Beginning | O(n) | O(1) |
Insert & Remove from the End | O(1) | O(n) |
Insert & Remove from the Middle | O(n) | O(n) |
Linked List: Intro(簡介)
https://alrightchiu.github.io/SecondRound/linked-list-introjian-jie.html
Array vs Linked List
https://www.javatpoint.com/ds-array-vs-linked-list
How to Implement a Linked List in JavaScript
https://www.freecodecamp.org/news/implementing-a-linked-list-in-javascript/
linked list intro
https://alrightchiu.github.io/SecondRound/linked-list-introjian-jie.html