码迷,mamicode.com
首页 >  
搜索关键字:median of two sorted    ( 17004个结果
[leetcode]Merge Sorted Array
Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that i...
分类:其他好文   时间:2014-07-25 02:34:44    阅读次数:162
poj 1975 Median Weight Bead(传递闭包 Floyd)
题意:n个珠子,给定它们之间的重量关系,按重量排序,求确定肯定不排在中间的珠子的个数 分析:因为n为奇数,中间为(n+1)/2,对于某个珠子,若有至少有(n+1)/2个珠子比它重或轻,则它肯定不排在中间 可以将能不能确定的权值初始化为0,能确定重量关系的权值设为1...
分类:其他好文   时间:2014-07-24 23:35:13    阅读次数:210
[leetcode]Add Binary
Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".算法思路:模拟二进制加法,跟十进制木有区别,将a,b转置(不转置的话,倒着...
分类:其他好文   时间:2014-07-24 22:57:23    阅读次数:216
import the library to Android Studio
To import the library to Android Studio, there is two methods that can (or cannot) work. The first one worked for me, but when I tried the second, it ...
分类:移动开发   时间:2014-07-24 22:42:13    阅读次数:284
Two Sum
Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of t...
分类:其他好文   时间:2014-07-24 22:32:52    阅读次数:194
【leetcode刷题笔记】Divide Two Integers
Divide two integers without using multiplication, division and mod operator.题解:要求不用乘除和取模运算实现两个数的除法。那么用加减法是很自然的选择。不过如果一次只从被除数中剪掉一个除数会TLE。所以我们借助移位运算,依次从...
分类:其他好文   时间:2014-07-24 17:09:15    阅读次数:203
redis研究笔记
一. redis Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes   http...
分类:其他好文   时间:2014-07-24 10:32:58    阅读次数:223
JavaScript中的两个“0”(翻译)
本文翻译自JavaScript’s two zerosJavaScript has two zeros: ?0 and +0. This post explains why that is and where it matters in practice.JavaScript 中有两个“0”: -0...
分类:编程语言   时间:2014-07-24 10:18:03    阅读次数:454
1:A+B Problem
总时间限制:1000ms内存限制:65536kB描述Calculate a + b输入Two integer a,,b (0 ≤ a,b ≤ 10)输出Output a + b样例输入1 2样例输出3提示Q: Where are the input and the output?A: Your pr...
分类:其他好文   时间:2014-07-24 10:07:23    阅读次数:287
poj 3349 -- Snowflake Snow Snowflakes
Snowflake Snow SnowflakesTime Limit: 4000MSMemory Limit: 65536KTotal Submissions: 30652Accepted: 8076DescriptionYou may have heard that no two snowfla...
分类:其他好文   时间:2014-07-24 10:04:03    阅读次数:283
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!