给定两个阵列,一个具有m个元素,一个具有n个元素。 [英] Given two arrays one with m elements and one with n elements.

查看:99
本文介绍了给定两个阵列,一个具有m个元素,一个具有n个元素。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定两个数组,一个包含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.

Quote:

查找两个阵列的中位数



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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆