public class Solution
{
public double FindMedianSortedArrays(int[] nums1, int[] nums2)
{
var nums = nums1.Concat(nums2).OrderBy(x => x).ToArray();
var len = nums.Length;
if (len % == )
{
return Convert.ToDouble(nums[len / ] + nums[len / - ]) / ;
}
else
{
return Convert.ToDouble(nums[len / ]);
}
}
}

leetcode4的更多相关文章

  1. leetcode-4. 寻找两个正序数组的中位数

    leetcode-4. 寻找两个正序数组的中位数. 给定两个大小为 m 和 n 的正序(从小到大)数组 nums1 和 nums2. 请你找出这两个正序数组的中位数,并且要求算法的时间复杂度为 O(l ...

  2. Leetcode4:Median of Two Sorted Arrays@Python

    There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two ...

  3. LeetCode4:Add Two Numbers

    题目: You are given two linked lists representing two non-negative numbers. The digits are stored in r ...

  4. LeetCode4 Median of Two Sorted Arrays

    题目: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the ...

  5. leetcode4 Valid Palindrome回文数

    Valid Palindrome回文数 whowhoha@outlook.com Question: Given a string, determine if it is a palindrome, ...

  6. LeetCode4. Median of Two Sorted Arrays---vector实现O(log(m+n)--- findkth

    这道题目和PAT上的1029是同一题.但是PAT1029用O(m+n)的时间复杂度(题解)就可以,这道题要求是O(log(m+n)). 这道题花费了我一个工作日的时间来思考.因为是log因而一直思考如 ...

  7. LeetCode-4. 两个排序数组的中位数(详解)

    链接:https://leetcode-cn.com/problems/median-of-two-sorted-arrays/description/ 有两个大小为 m 和 n 的排序数组 nums ...

  8. [Swift]LeetCode4. 两个排序数组的中位数 | Median of Two Sorted Arrays

    There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two ...

  9. leetcode4:两个排序数组的中位数

    给定两个大小为 m 和 n 的有序数组 nums1 和 nums2 . 请找出这两个有序数组的中位数.要求算法的时间复杂度为 O(log (m+n)) . 1.我的思路:直接用sort,时间复杂度应如 ...

随机推荐

  1. vue与mapbox

    1.引入mapbox 在index.html里面引入maobox gl 或者使用 npm install mapbox-gl 2.功能 我主要这次要实现 地图展示 地图打点(添加Marker) 地图的 ...

  2. 王者荣耀交流协会第五次Scrum立会

    会议时间:2017年10月24号   11:40-12:12,时长32分钟. 会议地点:信息科学与技术学院107教室 昨天工作: 组长使用ZedGraph实现了折线图的生成,基本符合需求,组员们分别完 ...

  3. js 自定义类Android吐司提示框

    (function(){     var mouseX = 0;     var mouseY = 0;     //定义一个全局toaslist用来存在新建的吐司     var toastLsit ...

  4. Unity Shader 矩阵基本信息

    基本信息 mul函数 mul函数,是表示矩阵M和向量V进行点乘,得到一个向量Z,这个向量Z就是对向量V进行矩阵变换后得到的值.  HLSL的mul函数接受mul(V, M)或mul(M, V),要注意 ...

  5. FTP服务-filezilla server 配置

    一.下载Filezilla  Server 官网网址:https://filezilla-project.org/download.php?type=server 二.安装Filezilla  Ser ...

  6. Tomcat报异常:Too many open files 的解决之路

    http://www.linuxeye.com/Linux/2781.html Tomcat报 Jul 21, 2015 8:45:23 AM org.apache.tomcat.util.net.J ...

  7. Oracle Sql Loader的学习使用

    最近由于遇到oracle控制文件的使用,虽然不是很复杂,但是从来没有用过,专门花点时间看看.点击 这里 查看详细 1,概述: Sql Loader: 一个批量工具,将文件数据导入到数据库.可以导入一个 ...

  8. python制作模块

    自己写的函数,为了下一次方便用,做成模块 主要有这几个步骤: 1:准备发布 2:构建发布 3:导入模块并使用 1:准备发布 首先,我自己写的一个打印出列表(含嵌套列表),打印出列表中的每个数据项,文件 ...

  9. Ubuntu 16.04出现:Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh > /dev/null; fi'

    错误: Reading package lists... Done E: Problem executing scripts APT::Update::Post-Invoke-Success 'if ...

  10. MySQL通过分组计算百分比

    公司在做柯米克的分析报告,需要我这边把汽车之家柯米克论坛的评论数据和评论用户所在地的数据获取,通过爬虫的方式很快的解决了数据的问题,但是需要我提取下各省评论人数的比例,所以在数据库里面直接计算了相关的 ...