码迷,mamicode.com
首页 >  
搜索关键字:merge two sorted lists    ( 21789个结果
Edit Distance
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:其他好文   时间:2014-05-10 01:09:28    阅读次数:325
Leetcode | Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t...
分类:其他好文   时间:2014-05-09 19:09:35    阅读次数:318
LeetCode OJ - Convert Sorted Array/List to Binary Search Tree
Array和List的区别在于前者可以随机访问,而后者只能顺序访问。对于把排好序的array转成BST,可以用top-down的方式,很直观也很自然,时间复杂度是O(n)。而对于List如果采用同样的方式,每次需要顺序遍历到中间节点,时间复杂度变成O(nlogn),如果换一种思路,down-top,...
分类:其他好文   时间:2014-05-05 09:34:29    阅读次数:454
归并排序(分治)
1 #include 2 #include 3 4 void MerageSort(int *A, int low, int high); 5 void Merge(int *A, int low, int middle, int high); 6 7 int main() 8 { ...
分类:其他好文   时间:2014-05-04 20:44:56    阅读次数:417
Javascript Array
ArraysArrays are zero-indexed, ordered lists of values. They are a handy way to store a set of related items of the same type (such as strings), thoug...
分类:编程语言   时间:2014-05-04 19:08:29    阅读次数:533
Oracle MERGE INTO的用法
很多时候我们会出现如下情境,如果一条数据在表中已经存在,对其做update,如果不存在,将新的数据插入.如果不使用Oracle提供的merge语法的话,可能先要上数据库select查询一下看是否存在,然后决定怎么操作,这样的话需要写更多的代码,同时性能也不好,要来回数据库两次.使用merge的话则可以一条SQL语句完成. 1)主要功能  提供有条件地更新和插入数据到数据库表中  如果该行存在...
分类:数据库   时间:2014-05-04 18:48:52    阅读次数:527
Codeforces Round #243 (Div. 1)——Sereja and Two Sequences
给两个长度分别为n和m的序列,现在有两种操作:1.分别选择两个序列的一个非空前缀,切两个前缀的最后一位相同,删除之,得到1分(只累计),消耗e;2.直接删除两个序列,消耗值定于两个序列之前删除的元素个数之和,并且使得得到的分有效(之前没有有效分)...
分类:其他好文   时间:2014-05-04 18:10:51    阅读次数:287
redis在windows下安装和PHP中使用
windows下安装redis1、redis简介redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hashs(哈希类型)。这些数据类型...
分类:Windows程序   时间:2014-05-04 12:37:46    阅读次数:848
一道模拟题
问题:把英文单词表示的数字转换为阿拉伯数字,要求数字不超过整形范围,数字形如abc,def,hrg。第一行表示有几组数据,第二行输入英文。输出:相应的阿拉伯数字。例如:input: 3 eleven one hundred and two output: 11102分析:要注意百万和千要断位,还有要...
分类:其他好文   时间:2014-05-04 12:32:10    阅读次数:326
jQuery -> Callbacks
Callbacks 是jQuery 1.7之后新加的一个工具,用于管理callback lists(函数数组)作为码农,经常被灌输这样的逻辑:真正厉害的不是写多么复杂的代码,而是写简单易懂的代码。不明就里的人则会把她作为衡量代码质量的准则,并抓住每一个抱怨的机会说道,“这代码真复杂,是给人看的吗!”...
分类:Web程序   时间:2014-05-04 12:28:07    阅读次数:355
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!