-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Level 2] In progress #13
base: NamelessOIer-master
Are you sure you want to change the base?
Conversation
level2/SkipList/1.cpp
Outdated
for(int i=0;i<Limit;++i)A[S].Next[i]=T; | ||
} | ||
|
||
inline int find(const int &k){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种函数不太可能被inline掉的,此处的inline还是去掉吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以前写inline
就是为了减少函数调用,卡下常数。然后觉得反正不能内联的编译器都会自动处理掉,就一直顺手写了。现在去看了点资料,感觉又涨知识了:)
level2/SkipList/1.cpp
Outdated
build(); | ||
while(1){ | ||
int k,v; | ||
switch(getchar()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议直接构造数组来测试,如果有兴趣的话,还可以看看TDD(测试驱动开发)https://www.jianshu.com/p/5ea25ceeccc4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈哈,感谢,我自己造数据发现了一个bug
另外我发现直接rand()
分层跑得确实很慢,所以修改了选层函数,现在期望复杂度感觉正确了
Bug fix. Generating testcase and test added. Changed the way to choose level of nodes.
文件过大,分成了4份
No description provided.