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

Upsides

The main benefits of a linked list are the abilities to grow very large in size cheaply, always maintain a certain direction, and allow to access items individually. What makes this data structure unique?

There are a few points:

  • Low overhead allocation per item.
  • Item count is only limited by heap memory.
  • Mutation while iterating is possible.
  • A direction is strictly enforced—there is no going back.
  • Implementation is fairly simple (even in Rust).
  • Efficient append, prepend, delete, and insert operations—compared to an array (no shifting required).

Generally, the linked list performs well in an environment where limited memory does not allow overhead allocation (as dynamic arrays do), or as a basis for an exotic lock-free data structure.

主站蜘蛛池模板: 蚌埠市| 南平市| 民权县| 察雅县| 建水县| 监利县| 乌鲁木齐市| 辽宁省| 琼中| 屏南县| 兴和县| 宣恩县| 平陆县| 上杭县| 洞口县| 丽江市| 阿克陶县| 韶山市| 元谋县| 九龙坡区| 福泉市| 东港市| 弥渡县| 巴彦县| 财经| 丰台区| 腾冲县| 湘潭县| 克什克腾旗| 灵武市| 会昌县| 柘城县| 石景山区| 宿松县| 稷山县| 丹东市| 汉沽区| 射阳县| 上饶市| 托里县| 定西市|