Skip to content

Add solution 035.Search Insertion Location in Java #20

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

Merged
merged 1 commit into from
Oct 16, 2018
Merged

Add solution 035.Search Insertion Location in Java #20

merged 1 commit into from
Oct 16, 2018

Conversation

Zhoutzzz
Copy link
Contributor

Solution 035
搜索插入位置

@Zhoutzzz Zhoutzzz changed the title Add solution 035.Search Insertion Location Add solution 035.Search Insertion Location in Java Oct 16, 2018
Copy link
Member

@yanglbme yanglbme left a comment

Choose a reason for hiding this comment

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

终于有其它小伙伴提供 Java 版的啦,谢谢~

刚刚 Review 了代码,在这我提几点小小的建议哈。

  • 代码尽量写的优雅。e.g.
if (nums[0] < target) {
     return 1;
} else {
     return 0; 
}

这一小段代码可以写成:

return nums[0] < target ? 1 : 0;
  • 代码要注意一个规范性,左花括号 { 前面需要有空格隔开。e.g.
if (nums.length == 1) {
    // ...
}
  • 对于技术文档,如 README,中英文 or 中文与数字之间需要有空格隔开。e.g.
首先判断传入的数组为 0,1 这样的长度。
  • 新增完整文件夹之后,可以在项目根目录 README.md 文件中增加导航链接。

@yanglbme yanglbme merged commit de5f485 into doocs:master Oct 16, 2018
@yanglbme
Copy link
Member

关于写作规范,可以参考中文技术文档的写作规范

@yanglbme yanglbme added the need optimization Improvement request label Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need optimization Improvement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants