We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
跳表的插入有这样的一段代码:
Node update[] = new Node[level]; for (int i = 0; i < level; ++i) { update[i] = head; } Node p = head; // 在 update 数组中记录每一层中小于value的最大的那个value for (int i = level - 1; i >= 0; --i) { while (p.forwards[i] != null && p.forwards[i].data < value) { p = p.forwards[i]; } update[i] = p; }
我理解
for (int i = 0; i < level; ++i) { update[i] = head; }
是多余的,因为下面的for循环会给各个层的update数组赋值
The text was updated successfully, but these errors were encountered:
No branches or pull requests
跳表的插入有这样的一段代码:
Node update[] = new Node[level];
for (int i = 0; i < level; ++i) {
update[i] = head;
}
Node p = head;
// 在 update 数组中记录每一层中小于value的最大的那个value
for (int i = level - 1; i >= 0; --i) {
while (p.forwards[i] != null && p.forwards[i].data < value) {
p = p.forwards[i];
}
update[i] = p;
}
我理解
for (int i = 0; i < level; ++i) {
update[i] = head;
}
是多余的,因为下面的for循环会给各个层的update数组赋值
The text was updated successfully, but these errors were encountered: