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

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| 河源市| 无棣县| 大埔县|