- Hands-On Data Structures and Algorithms with Rust
- Claus Matzinger
- 171字
- 2021-07-02 14:11:51
Linked lists
To keep track of a bunch of items, there is a simple solution: with each entry in the list, store a pointer to the next entry. If there is no next item, store null/nil/None and so on, and keep a pointer to the first item. This is called a singly linked list, where each item is connected with a single link to the next, as shown in the following diagram—but you already knew that:

What are the real use cases for a linked list though? Doesn't everyone just use a dynamic array for everything?
Consider a transaction log, a typical append-only structure. Any new command (such as a SQL statement) is simply appended to the existing chain and is eventually written to a persistent storage. Thus, the initial requirements are simple:
- Append a command to an existing list
- Replay every command from the beginning to the end—in that order
In other words, its a queue (or LIFO—short for Last In First Out) structure.
- 數(shù)據(jù)庫(kù)原理及應(yīng)用教程(第4版)(微課版)
- Python數(shù)據(jù)分析、挖掘與可視化從入門到精通
- PySpark大數(shù)據(jù)分析與應(yīng)用
- WS-BPEL 2.0 Beginner's Guide
- Oracle PL/SQL實(shí)例精解(原書第5版)
- 數(shù)據(jù)科學(xué)工程實(shí)踐:用戶行為分析與建模、A/B實(shí)驗(yàn)、SQLFlow
- 圖數(shù)據(jù)實(shí)戰(zhàn):用圖思維和圖技術(shù)解決復(fù)雜問題
- TextMate How-to
- 數(shù)據(jù)庫(kù)技術(shù)及應(yīng)用
- 區(qū)塊鏈技術(shù)應(yīng)用與實(shí)踐案例
- 數(shù)據(jù)分析師養(yǎng)成寶典
- Hadoop 3實(shí)戰(zhàn)指南
- Oracle高性能SQL引擎剖析:SQL優(yōu)化與調(diào)優(yōu)機(jī)制詳解
- 數(shù)據(jù)挖掘競(jìng)賽實(shí)戰(zhàn):方法與案例
- Managing Software Requirements the Agile Way