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

细节疑问 #6

Open
qingsuijiu opened this issue Nov 4, 2021 · 1 comment
Open

细节疑问 #6

qingsuijiu opened this issue Nov 4, 2021 · 1 comment

Comments

@qingsuijiu
Copy link

qingsuijiu commented Nov 4, 2021

  1. insert_element函数中,此处第二个if是否可以直接修改为else
    if (current != NULL && current->get_key() == key) { //... }
    if (current == NULL || current->get_key() != key) { //... }
  2. delete_element处没有释放节点内存
  3. skiplist的析构函数也没有释放头节点外其它节点的内存
@zpengc
Copy link

zpengc commented Dec 28, 2021

@qingsuijiu
可以直接改成else

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

2 participants