题目:
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in p...
分类:
编程语言 时间:
2015-07-10 22:22:11
阅读次数:
198
int TreeDepth(BinaryTreeNode* pRoot)
{
if (pRoot == NULL)
return 0;
int nLeft = TreeDepth(pRoot->m_pLeft);
int nRight = TreeDepth(pRoot->m_pRight);
return (nLeft > nRight) ? (nLeft + 1) : (nRigh...
分类:
其他好文 时间:
2015-07-10 22:22:09
阅读次数:
156
bool FindNumbersWithSum(int data[], int length, int sum, int* num1, int* num2)
{
bool found = false;
if (length
return found;
int ahead = length - 1;
int behind = 0;
while (ahead > behind)
{
...
分类:
其他好文 时间:
2015-07-10 22:19:03
阅读次数:
195
完美运动框架,包括有style和opacity的样式实现//以下是运动框架的内容function getStyle(obj, name){ if(obj.currentStyle) //仅IE { return obj.currentStyle[name]; } ...
分类:
其他好文 时间:
2015-07-10 22:08:46
阅读次数:
184
Given a binary tree, return the preorder traversal of its nodes’ values.For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
return [1,2,3].Note: Recursive solution is trivial,...
分类:
其他好文 时间:
2015-07-10 20:53:50
阅读次数:
123
# include # include # include # include using namespace std;int max(int a,int b){ return a>b?a:b;}int main(){ int T,n,t,k,m,i,hh,min,id,num,x; int las...
分类:
其他好文 时间:
2015-07-10 20:35:52
阅读次数:
137
int InversePairs(int* data, int length)
{
if (data == NULL || length
return 0;
int *copy = new int[length];
for (int i = 0; i
copy[i] = data[i];
int count = InversePairsCore(data, copy, 0, le...
分类:
编程语言 时间:
2015-07-10 19:17:44
阅读次数:
113
mem = new Memcache(); } /** * 链接memcahce服务 * * @access private * @param string $key 关键字 * @param string $value 缓存内容 * @return array */ private functi....
分类:
Web程序 时间:
2015-07-10 18:41:59
阅读次数:
168
javascript的return语句简单介绍:return语句在js中非常的重要,不仅仅具有返回函数值的功能,还具有一些特殊的用法,有个清晰的把握是非常有必要的。下面就结合实例简单介绍一下return语句的作用。一.用来返回控制和函数结果:通常情况,return语句对于一个函数是很有必要的,因为往...
分类:
编程语言 时间:
2015-07-10 18:35:58
阅读次数:
146
1.首先禁用window原生的右键弹窗(禁用包括2个区域,1是鼠标右键的区域div 2是弹出窗口的div): //禁用区域右键 $('body').on('contextmenu','.bottompage',function(){ return false; });...
分类:
其他好文 时间:
2015-07-10 18:23:19
阅读次数:
152