Question 1: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...
分类:
其他好文 时间:
2014-05-19 09:35:41
阅读次数:
321
Given an array of non-negative integers, you
are initially positioned at the first index of the array.Each element in the
array represents your maximu...
分类:
其他好文 时间:
2014-05-19 08:23:07
阅读次数:
223
Given an array of non-negative integers, you
are initially positioned at the first index of the array.Each element in the
array represents your maximu...
分类:
其他好文 时间:
2014-05-19 08:07:26
阅读次数:
288
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-05-18 20:30:16
阅读次数:
301
早上公交上总想这个问题,终于写出来了,不知道有错误没 1 $chinese =
array("零","一","二","三","四","五","六","七","八","九"); 2 $str = 140032002005; 3 $arr =
array(); 4 ...
分类:
其他好文 时间:
2014-05-18 19:27:44
阅读次数:
262
1:array_shift():调用了方法是把第一个值移除(算法:先进先出)2:array_pop():调用了方法是把最后一个移除,但是返回的是最后一值(算法:后进先出)3:mysql_affected_rows():表示几行受影响,成功,肯定是大于0,否则失败4:正则表达式
例:var reg.....
分类:
Web程序 时间:
2014-05-17 21:06:55
阅读次数:
335
1:完整版的封装函数(增(insert),删(delete),改(update))
例:2:strcasecmp:比较两个数谁大谁小和是否相等(计算法:二进制) 例:strcasecmp("ab","ac")
ac比ab大3:array_shift():调用了方法是把第一个...
分类:
数据库 时间:
2014-05-17 14:53:42
阅读次数:
287
【题目】
给定两个字符串s1和s2,要求判断s2是否能够被通过s1做循环移位(rotate)得到的字符串包含。例如,S1=AABCD和s2=CDAA,返回true;给定s1=ABCD和s2=ACBD,返回false。
【分析】
【思路一】
从题目中可以看出,我们可以使用最直接的方法对S1进行循环移动,再进行字符串包含的判断,从而遍历其所有的可能性。
字符串循环移动,时间复杂度为O(n...
分类:
其他好文 时间:
2014-05-16 02:56:14
阅读次数:
305
一维数组示例如下:--Createdon2014-5-15byADMINISTRATOR
DECLARE
TYPEArr1ISVARRAY(10)OFNUMBER;
Tab_1Arr1;
TYPEArr2ISTABLEOFNUMBERINDEXBYBINARY_INTEGER;
Tab_2Arr2;
BEGIN
--Teststatementshere
Tab_1:=Arr1(1,3,4,6,3,2,8,5);
FORaIN1..Tab_1.CountLOOP
Dbms_Output.Put..
分类:
数据库 时间:
2014-05-16 02:28:48
阅读次数:
371
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero....
分类:
其他好文 时间:
2014-05-16 01:34:36
阅读次数:
293