- Hands-On Data Structures and Algorithms with Rust
- Claus Matzinger
- 194字
- 2021-07-02 14:11:51
Lists, Lists, and More Lists
Lists are everywhere: shopping lists, to-do lists, recipes, street numbers in western countries... simply everywhere. Their defining characteristic, storing things in a linear, defined relationship with each other, helps us keep track of stuff and find it again later on. From a data structure perspective, they are also essential to almost any program and come in various shapes and forms. While some lists are tricky to implement in Rust, the general principles can be found here as well, along with some valuable lessons on the borrow checker! After this chapter, we want you to know more about the following:
- (Doubly) linked lists and when you should use them
- Array lists, better known as Rust's vector
- Skip lists and, ideally, the New York metro subway system
- Implementing a simple transaction log
As a final note, this chapter will build safe implementations of various lists, even though unsafe versions could be faster and require less code. This decision is due to the fact that, when working on regular use cases, unsafe is almost never a solution. Check out the links in the Further reading section of this chapter for unsafe lists.
推薦閱讀
- Unity 5.x Game AI Programming Cookbook
- SQL Server入門經(jīng)典
- Oracle RAC 11g實戰(zhàn)指南
- Mockito Cookbook
- 數(shù)據(jù)庫原理與應(yīng)用(Oracle版)
- Scratch 3.0 藝術(shù)進階
- 跨領(lǐng)域信息交換方法與技術(shù)(第二版)
- SIEMENS數(shù)控技術(shù)應(yīng)用工程師:SINUMERIK 840D-810D數(shù)控系統(tǒng)功能應(yīng)用與維修調(diào)整教程
- 商業(yè)智能工具應(yīng)用與數(shù)據(jù)可視化
- NoSQL數(shù)據(jù)庫原理(第2版·微課版)
- Artificial Intelligence for Big Data
- 從零進階!數(shù)據(jù)分析的統(tǒng)計基礎(chǔ)(第2版)
- Unity 4.x Game AI Programming
- 產(chǎn)品經(jīng)理數(shù)據(jù)修煉30問
- Oracle數(shù)據(jù)庫性能優(yōu)化的藝術(shù)