Linked lists have long served as a valuable teaching tool in programming.However, the question arises: Are they truly practical for everyday program use? In most cases, it appears that array-based data structures offer distinct advantages, particularly in terms of memory efficiency and,more importantly, execution speed.While it's relatively straightforward to calculate the complexity of operations, gauging actual execution efficiency remains a challenge.This paper addresses this question by introducing a new benchmark.Our study compares various linked list implementations with several array-based alternatives.We also demonstrate the ease of incorporating memory caching for linked lists, enhancing their performance.Additionally, we introduce a new array-based data structure designed to excel in a wide range of operations.
翻译:链表长期以来一直是编程中宝贵的教学工具。然而,问题随之而来:它们在日常程序使用中是否真正实用?在大多数情况下,基于数组的数据结构似乎具有明显优势,尤其是在内存效率以及(更为重要的)执行速度方面。虽然操作复杂度的计算相对直接,但衡量实际执行效率仍是一个挑战。本文通过引入一个新的基准测试来探讨这一问题。我们的研究比较了各种链表实现与多种基于数组的替代方案。我们还展示了为链表引入内存缓存的简便性,从而提升其性能。此外,我们介绍了一种新的基于数组的数据结构,旨在广泛操作中表现出色。