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
书上的代码:
indexMid = (index1 + index2) / 2;
如果数组很长,并且最小值在比较靠后的位置(两个index都比较大)那就有可能导致算出的indexMid不正确。一般来说不都是这样写吗?
indexMid = index1 + (index2 - index1) / 2;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
书上的代码:
indexMid = (index1 + index2) / 2;
如果数组很长,并且最小值在比较靠后的位置(两个index都比较大)那就有可能导致算出的indexMid不正确。一般来说不都是这样写吗?
indexMid = index1 + (index2 - index1) / 2;
The text was updated successfully, but these errors were encountered: