Given a sorted array, remove the duplicates in
place such that each element appear onlyonceand return the new length.Do not
allocate extra space for a...
分类:
其他好文 时间:
2014-06-04 21:38:05
阅读次数:
233
Mergeksorted linked lists and return it as one
sorted list. Analyze and describe its
complexity./***Definitionforsingly-linkedlist.*structListNode{*in...
分类:
其他好文 时间:
2014-06-04 21:08:57
阅读次数:
381
Given two binary strings, return their sum
(also a binary string).For example,a ="11"b ="1"Return"100".class Solution
{public: string addBinary(str...
分类:
其他好文 时间:
2014-05-30 08:39:11
阅读次数:
270
1、归并排序 2、内排序和外排序 外排序的一个例子是外归并排序(External merge
sort),它读入一些能放在内存内的数据量,在内存中排序后输出为一个顺串(即是内部数据有序的临时文件),处理完所有的数据后再进行归并。比如,要对 900 MB
的数据进行排序,但机器上只有 100 MB 的...
分类:
其他好文 时间:
2014-05-30 00:13:46
阅读次数:
257
SQL Server 2008 引入了一个称为MERGE
的语句,它能在一条语句中根据逻辑条件对数据进行不同的修改操作(INSERT、UPDATE和DELETE)。MERGE语句是SQL
标准的一部分,而T-SQL版本的MERGE语句也增加了一些非标准的扩展。因为MERGE语句是新增的,所以必须使用...
分类:
其他好文 时间:
2014-05-29 22:54:21
阅读次数:
262
题意大概是给出一个数列num,和一个目标数target,然后要找出数列中的两个数,使得这两个数之和等于目标数,输出这两个数的下标值(从1开始算)。
一个比较暴力的方法是用一个二重循环直接遍历序列,在第一重循环中找到a,在第二重循环中找到b,使得a+b=target,这种做法的时间复杂度是O(n^2....
分类:
其他好文 时间:
2014-05-29 21:01:06
阅读次数:
307
.oLi-lists-scroll::-webkit-scrollbar { width:5px;
padding:1px; background:url(../images/repeat-bar.png) repeat-y;}/* Track
*/.oLi-lists-scroll::-webki...
分类:
Web程序 时间:
2014-05-29 19:02:39
阅读次数:
386
动机: 想在Oracle中用一条SQL语句直接进行Insert/Update的操作。 说明:
在进行SQL语句编写时,我们经常会遇到大量的同时进行Insert/Update的语句
,也就是说当存在记录时,就更新(Update),不存在数据时,就插入(Insert)。 merge into...
分类:
其他好文 时间:
2014-05-29 16:27:58
阅读次数:
281
本篇文章介绍下redis排序命令.redis支持对list,set和sorted
set元素的排序。排序命令是sort 完整的命令格式如下:SORT key [BY pattern] [LIMIT start count] [GET
pattern] [ASC|DESC] [ALPHA] [STOR...
分类:
其他好文 时间:
2014-05-29 09:02:28
阅读次数:
318
Problem: Given a two-dimensional graph with
points on it, find a line which passes the most number of points.此题是Cracking the
code 5th edition 第七章第六题,思...
分类:
其他好文 时间:
2014-05-29 08:10:38
阅读次数:
292