官术网_书友最值得收藏!

Wrap up

A (transaction) log is a great use case for a linked list: They often grow to unexpected sizes, and indexing is not required. While a linked list is often a very simple type in other languages, it harbors a surprising amount of challenges in Rust. This is mostly due to the borrowing and ownership concepts which require a programmer to think about what goes where in great detail. For real-world use cases, however, it's better to use Rust's standard library linked list (std::collections::LinkedList). From a performance perspective, finding a particular item in the singly linked list requires looking at the entire list in the worst case, resulting in a runtime complexity of O(n), with n being the number of items in the list (more on the topic of runtime complexity in Chapter 8, Algorithm Evaluation).

主站蜘蛛池模板: 吉首市| 云安县| 中宁县| 长泰县| 武城县| 抚顺县| 张家港市| 灌阳县| 邵东县| 西丰县| 武清区| 东光县| 锡林浩特市| 赫章县| 晋江市| 兴安盟| 叙永县| 兴海县| 太仓市| 根河市| 湘阴县| 通山县| 墨竹工卡县| 舞钢市| 类乌齐县| 运城市| 嫩江县| 邵阳县| 靖安县| 宜城市| 泸西县| 吉林省| 贵阳市| 张掖市| 太白县| 大同县| 吉木乃县| 瑞丽市| 雅安市| 闽侯县| 洞头县|