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
你好,在算法004的题目中,既然是两个已经排序好的数组中,要取这两个数组的中位数,为什么不直接去第一个数组的中位数,再去第二个数组的中位数,最后取这两个中位数的平均值,不就是结果了吗?感觉看004的算法有点复杂。我这样的算法是否有什么问题,还望告知,谢谢!
The text was updated successfully, but these errors were encountered:
那你是想太少了,比如 {1},{1, 2} 你的结果对吗,而且题目要求时间复杂度是 O(log (m+n))
{1}
{1, 2}
O(log (m+n))
Sorry, something went wrong.
No branches or pull requests
你好,在算法004的题目中,既然是两个已经排序好的数组中,要取这两个数组的中位数,为什么不直接去第一个数组的中位数,再去第二个数组的中位数,最后取这两个中位数的平均值,不就是结果了吗?感觉看004的算法有点复杂。我这样的算法是否有什么问题,还望告知,谢谢!
The text was updated successfully, but these errors were encountered: