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

手撕代码双向链表实现LRU里的show函数 #15

Open
jackson-119 opened this issue Mar 22, 2024 · 0 comments
Open

手撕代码双向链表实现LRU里的show函数 #15

jackson-119 opened this issue Mar 22, 2024 · 0 comments

Comments

@jackson-119
Copy link

void LRUCache::show(){
//链表中没有节点,退出
if(head_node->next = head_node){
return;
}
Node* tmp = head_node->next;
while(tmp->next != head_node){
std::cout<<"key:"<key<<",vlaue:"<value<<std::endl;
}
}

这里的while循环是不是有点问题啊,条件应该是tmp!=head_node,里面应该加一句tmp=tmp->next?

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