给定两个阵列,一个具有m个元素,一个具有n个元素。 [英] Given two arrays one with m elements and one with n elements.
问题描述
给定两个数组,一个包含m个元素,另一个包含n个元素。如果合并,找到两个数组的中位数。 m和n是不同的大小。提供O(1)空间复杂度和最小时间复杂度的最优化解决方案。
我尝试过:
给定两个数组,一个包含m个元素,另一个包含n个元素。如果合并,找到两个数组的中位数。 m和n是不同的大小。提供O(1)空间复杂度和最小时间复杂度的最优化解决方案。
其实没什么。我需要一些具体的方向。
Given two arrays one with m elements and one with n elements. Find median of the two arrays if combined. m and n is different sizes. Give the most optimized solution with O(1) space complexity and minimum time complexity.
What I have tried:
Given two arrays one with m elements and one with n elements. Find median of the two arrays if combined. m and n is different sizes. Give the most optimized solution with O(1) space complexity and minimum time complexity.
Actually nothing. I need some concrete direction.
推荐答案
我需要一些具体的方向。
I need some concrete direction.
首先在互联网上搜索。
Start by doing search on internet.
查找两个阵列的中位数
go go google.g>
拿一张纸和一支铅笔,然后尝试手工制作样品。
一旦你知道该怎么做,它基本上就是你的算法。
go Google.
Take a sheet of paper and pencil, then try to do samples by hand.
Once you know how to do, it is basically your algorithm.
这篇关于给定两个阵列,一个具有m个元素,一个具有n个元素。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!