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

hw02 done #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

hw02 done #69

wants to merge 1 commit into from

Conversation

Leo-AO-99
Copy link

1.修改next,prev指针
类似于课上所讲的情况,两个共享指针互相指向,会造成循环引用,引用计数无法置零,无法被回收。前一个指针“拥有”后一个指针,next为unique,prev为普通指针。
2.构造函数优化
可以使用引用,如果为模板类,可以优化速度,模板类尝试修改了一部分,学艺不精,以后再尝试。
3.修改了insert的逻辑
4.erase因为指针类型的修改,需要修改顺序
5.析构函数
每有一个Node就应该调用一次,原始案例中少了因为有循环引用问题,没有回收空间。
6.为什么删除拷贝赋值函数也不出错?
因为代码中没有调用
7.做了些简单的越界处理
8.print函数修改
增加引用

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

Successfully merging this pull request may close these issues.

1 participant