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
https://chunchengwei.github.io/shua-ti/yi-ge-you-guan-er-fen-fa-de-mian-shi-ti/
问题:给定一个有序数组,再给定一个数c,判断数组中是否存在两个数a,b,满足a + b = c。要求时间复杂度$O(n)$,空间复杂度$O(1)$。 解决方法:利用首尾两个指针,计算首尾的和,如果小于c,就移动首指针+1,否则就移动尾指针-
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://chunchengwei.github.io/shua-ti/yi-ge-you-guan-er-fen-fa-de-mian-shi-ti/
问题:给定一个有序数组,再给定一个数c,判断数组中是否存在两个数a,b,满足a + b = c。要求时间复杂度$O(n)$,空间复杂度$O(1)$。
解决方法:利用首尾两个指针,计算首尾的和,如果小于c,就移动首指针+1,否则就移动尾指针-
The text was updated successfully, but these errors were encountered: