原文:[LeetCode] Intersection of Two Arrays 两个数组相交

Given two arrays, write a function to compute their intersection. Example:Givennums , , , ,nums , , return . Note: Each element in the result must be unique. The result can be in any order. 这道题让我们找两个 ...

2016-05-18 23:33 4 21085 推荐指数:

查看详情

LeetCode:4_Median of Two Sorted Arrays | 求两个排序数组的中位数 | Hard

题目: 解题思路:   我自己想的方法,先排序在查找。两个数组,首先想到是归并排序,然后再查找两个数组合并之后的中间元素即为中位数。我们分析下时间复杂度主要用在了归并排序上,为O((m+n)log(m+n)),显然不符合题目要求。题目要求是O(log(m+n ...

Mon Dec 28 20:24:00 CST 2015 1 2967
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM