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

1.1章节第练习题1.1.29有点问题,就是如果key值大于a中所有元素的值时,应该返回a.length。 #15

Open
switchplus opened this issue Jul 7, 2021 · 0 comments

Comments

@switchplus
Copy link

public static int rank(int key, int[] a) {
if(key>a[a.length-1])return a.length; //如果key打印a中的每一个元素,则返回a的长度
return rank(key, a, 0, a.length - 1);
}这是修改后的代码

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

No branches or pull requests

1 participant