问题标签 [mem.-efficient-linkedlist]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c - How 'memory efficient doubly linked list' works?
In Data Structures and Algorithms Made Easy, struct
of memory efficient memory list given as follows,
In ptrdiff
, there will be xoring of previous and next node is done. For example, previous node have address 100 and next node address is 500.
So, in ptrdiff address will be 400. Now how it is possible to move to next or previous node (as we do in doubly link list), just by knowing xoring of their addresses?
Am I missing any step here?
c - 什么是 C 中的内存高效双向链表?
我在阅读一本关于 C 数据结构的书时遇到了“内存高效的双向链表”一词。它只有一行说内存高效的双向链表比普通的双向链表使用更少的内存,但做同样的工作。没有更多的解释,也没有给出例子。只是给出了这是从一本期刊中摘录的,括号中是“Sinha”。
在谷歌上搜索后,我最接近的是这个。但是,我什么都听不懂。
有人可以解释一下什么是 C 中的内存高效双向链表吗?它与普通的双向链表有何不同?
编辑:好的,我犯了一个严重的错误。请参阅我上面发布的链接,是文章的第二页。我没有看到有第一页,并认为给出的链接是第一页。文章的第一页实际上给出了解释,但我认为它并不完美。它只讨论内存高效链表或 XOR 链表的基本概念。