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
howMany()方法,在最坏情况下,复杂度为O(n),如果一个数组的所有元素都是指定的可以,那循环就会执行n次。 我觉得正确的做法应该是,参考前一题,先找出最小索引,再找出最大索引,这两个操作都是对数级的复杂度,然后直接就能求出结果。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
howMany()方法,在最坏情况下,复杂度为O(n),如果一个数组的所有元素都是指定的可以,那循环就会执行n次。
我觉得正确的做法应该是,参考前一题,先找出最小索引,再找出最大索引,这两个操作都是对数级的复杂度,然后直接就能求出结果。
The text was updated successfully, but these errors were encountered: