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

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).

主站蜘蛛池模板: 南宁市| 商水县| 合川市| 福海县| 同德县| 洮南市| 扶余县| 温宿县| 洱源县| 宝兴县| 罗甸县| 屏边| 台南县| 临武县| 甘南县| 英吉沙县| 白水县| 洪江市| 曲阳县| 柳江县| 耿马| 绍兴市| 腾冲县| 江门市| 秦皇岛市| 龙门县| 溧水县| 韶关市| 惠东县| 龙山县| 尖扎县| 连南| 德清县| 沅陵县| 景泰县| 延吉市| 南丹县| 文化| 白城市| 佛学| 海盐县|