Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis过期key是怎么样清理的?中LRU算法 PS部分表述问题 #24

Open
Feyl opened this issue Jan 25, 2022 · 0 comments
Open

Comments

@Feyl
Copy link

Feyl commented Jan 25, 2022

Redis过期key是怎么样清理的?

  • LRU算法 中 PS

PS:使用单向链表能不能实现呢,也可以,单向链表的节点虽然获取不到pre节点的信息,但是可以将下一个节点的key和value设置在当前节点上,然后把当前节点的next指针指向下下个节点,这样相当于把下一个节点删除了

感觉应该是把当前节点删除了,因为下一个节点的 key 和 value 都被赋值到当前节点上了。表面上删除下一个节点,实际上删除的是当前节点。因为当前节点的内容丢失了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant