class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int total = nums1.size() + nums2.size(); if (total % ...
分类:
其他好文 时间:
2017-01-29 20:41:33
阅读次数:
234
There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your tas ...
分类:
其他好文 时间:
2017-01-25 14:29:35
阅读次数:
173
方法1:Time Complexity O(NK) 暂时只有两个Heap的做法,缺点:In this problem, it is necessary to be able remove elements that are not necessarily at the top of the heap ...
之前写过一篇,这是第二篇。上一篇用了多种编程语言来做,这一次是以学算法为主,所以打算都用python来完成。 4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n resp ...
分类:
其他好文 时间:
2017-01-15 21:29:47
阅读次数:
173
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2017-01-15 18:12:12
阅读次数:
188
【题目链接】 http://poj.org/problem?id=3579 【题目大意】 给出一个数列,求两两差值绝对值的中位数。 【题解】 因为如果直接计算中位数的话,数量过于庞大,难以有效计算, 所以考虑二分答案,对于假定的数据,判断是否能成为中位数 此外还要使得答案尽可能小,因为最小的满足是中 ...
分类:
其他好文 时间:
2016-12-21 16:01:49
阅读次数:
124
Who's in the Middle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16668 Accepted Submission(s): ...
分类:
其他好文 时间:
2016-12-18 15:13:49
阅读次数:
141
本题精妙之处在于:1. 如何最快找到possible的line的x axis(我最开始想到要用quickselect find median的方法,结果别人有min max方法) 2. 如何最方便确定一个点关于该line的reflection是否存在,由于既有x又有y,不太好处理,别人有个聪明的办法 ...
分类:
其他好文 时间:
2016-12-16 08:00:28
阅读次数:
215
Just like meeting point problem, find the median elements in the array after sorting, so Solution 1: Sort, find the median: O(NlogN) Solution 2: Quick ...
分类:
其他好文 时间:
2016-12-10 07:01:27
阅读次数:
167
InfluxDB是一个开源分布式时序、事件和指标数据库。使用Go语言编写,无需外部依赖。其设计目标是实现分布式和水平伸缩扩展。它有三大特性:1.TimeSeries(时间序列):你可以使用与时间有关的相关函数(如最大,最小,求和等)2.Metrics(度量):你可以实时对大量数据进行计算..
分类:
数据库 时间:
2016-12-09 08:52:38
阅读次数:
672