Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all uniquetriplets in the array which gives the sum of z...
分类:
其他好文 时间:
2014-06-29 00:21:06
阅读次数:
237
Combination Sum:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.The...
分类:
其他好文 时间:
2014-06-28 22:48:01
阅读次数:
256
$m =gwmi Win32_PhysicalMemory$m|measure -Property capacity #计算 Property 出现次数$m|measure -Property capacity -sum #计算 Property的总和
分类:
其他好文 时间:
2014-06-28 22:37:49
阅读次数:
271
Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m...
分类:
其他好文 时间:
2014-06-28 22:05:10
阅读次数:
267
1.简单形式:得到数据库中客户 的数量:var q = db.Customers.Count();2.带条件形 式:得到数据库中未断货产品的数量:var q = db.Products.Count(p => !p.Discontinued);LongCount说明 :返回集合中的元素个数,返回LON...
分类:
数据库 时间:
2014-06-28 21:30:36
阅读次数:
274
题目
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 the two numbers such that they add up to the...
分类:
其他好文 时间:
2014-06-18 12:05:44
阅读次数:
244
双端队列(Deque:double ended queue)就是一个两端都是结尾的队列。队列的每一端都可以插入数据项和移除数据项。相对于普通队列,双端队列的入队和出队操作在两端都可进行。这里我们使用最常用的顺序结构来存储双端队列,为了节省空间,把它首尾相连,构成循环队列。并且规定left指向左端的第一个元素,right指向右端的下一个位置。那么队空的判断则是left==right,队满是(left-1+MAX)%MAX==right或者(right-left+MAX)%MAX==MAX。...
分类:
其他好文 时间:
2014-06-18 00:40:38
阅读次数:
296
初识泛型算法
理解算法的最基本方法是了解他们是否读取元素、改变元素或是重排元素顺序!
只读算法
#include
#include
using namespace std;
//对vec中的元素求和,初值是0
int sum=accumulate(vec.cbegin(), vec.cend(), 0);
这里面第三个参数决定了函数使用哪个加法运算符以及返回值类型。
...
分类:
编程语言 时间:
2014-06-17 19:12:26
阅读次数:
261
innodb_buffer_pool_size80%(系统缓存池)innodb_log_file_size4G(mysql5.5中限定的最大数值,redo日志增大提高性能,redo日志小崩溃后恢复更快)\\开始将这个值设置为512M可以拥有1G的的redo日志,会使得拥有充裕的写操作空间max_connections151(默认值,需要修改)innodb_file..
分类:
数据库 时间:
2014-06-17 17:53:28
阅读次数:
289
#100以内整数和
#!/bin/sh
declare-iSUM=0
for((i=1;i<=100;i+=1))
do
letSUM+=$i
done
echo$SUM
#!/bin/sh
declare-iSUM=0
foriin{1..100}
do
letSUM+=$i
done
echo$SUM
#100以内偶数和
#!/bin/sh
declare-iSUM=0
for((i=2;i<=100;i+=2))
do
letSUM+=$i
done
echo$SUM..
分类:
其他好文 时间:
2014-06-17 17:46:32
阅读次数:
232