c++ - 为什么我要在 C++ 中实现我自己的双向链表?

标签 c++ list

<分区>

除了通过在 C++ 中实现我自己的双向链表来学习一些学术方面的知识外,在已经存在 std::list 的情况下实现我自己的双向链表是否有任何实际的实际优势?我能否自行提高某项任务的效率,或者 std::list 多年来经过如此多的改进,以至于在大多数情况下它是双向链表的最佳实现?

最佳答案

is there any actual real-world advantage of implementing my own doubly linked list when there is already std::list?

可能不会。

Can I make things more efficient on my own for a certain task,

也许 - 取决于任务。例如,您可能只需要一个单链表,最终可能会更快。

or has std::list been refined so much over the years that it is the optimal implementation of a doubly linked list in most cases?

可能。

所有这些问题的最佳答案可能是“使用标准实现直到它不起作用,然后再想办法解决它。”

关于c++ - 为什么我要在 C++ 中实现我自己的双向链表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19278502/

相关文章:

c++ - 点对点线性渐变?

android - 如何应用随机数字列表从数组中选择图像?

python - 在嵌套字典/列表中传输值

c++ - 在 C++ 中将指针转换为数组

C++ 类库动态运行时分配

c++ - 如何将用户输入存储在与默认构造函数中的变量初始化值不同的变量中?

c++ - 线程池实现 : condition_variables vs. yield()

java - java链表中两个相邻节点的交换

c# - 无效操作异常 : The type of the argument object 'Scratch' is not primitive

Java List<String> 转为 Short