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

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

主站蜘蛛池模板: 九江市| 盐亭县| 哈密市| 宕昌县| 德庆县| 大宁县| 珠海市| 延安市| 临夏县| 铜山县| 花垣县| 旬邑县| 辛集市| 柳河县| 沁阳市| 湾仔区| 胶州市| 霍林郭勒市| 化德县| 长宁区| 宾川县| 尉犁县| 彩票| 冕宁县| 乌苏市| 西畴县| 巧家县| 景东| 凌云县| 蒙自县| 石屏县| 舞阳县| SHOW| 定安县| 成安县| 兴仁县| 吉木萨尔县| 通许县| 崇左市| 舟曲县| 南安市|