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

feat(docs/basic): 添加Java语言代码示例 (#4243) #5477

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

he-weilai
Copy link
Contributor

  • 我已认真阅读贡献指南 (contributing guidelines) 和社区公约 (code of conduct),并遵循了如何参与页及格式手册页的相应规范。

@Tiphereth-A

This comment was marked as resolved.

@Tiphereth-A Tiphereth-A changed the title feat(docs/basic):添加Java语言代码示例 (#4243) feat(docs/basic): 添加Java语言代码示例 (#4243) Mar 27, 2024
@Tiphereth-A

This comment was marked as resolved.

@he-weilai

This comment was marked as resolved.

Comment on lines +120 to +122
for (int i = 0; i < n; ++i) {
bucket.add(new ArrayList<>());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这里之前是不是需要先清空一下 bucket 🤔

}
for (int i = 1; i <= n; ++i) {
int index = a[i] / bucketSize;
if (index >= n) index = n - 1; // 避免数组越界
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

桶排序假定了 $\max_i a_i \leq w$,所以这行是多余的

Comment on lines +230 to +231
=== "Python"
```python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Python?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants