#include int Search(char *s1, char *s2) { char *temp = s1; int count = 0; while(*temp != '\0') { char *tmp1 = temp; char *t1 = s2; while(*t1 != '\0...
分类:
其他好文 时间:
2015-06-10 19:13:12
阅读次数:
135
for(inti=0;i<dataTable.Rows.Count;i++){for(intj=0;j<dataTable.Columns.Count;j++){Console.WriteLine(dataTable.Rows[i][j].ToString());}}
分类:
其他好文 时间:
2015-06-10 19:01:42
阅读次数:
150
Setargs=WScript.Arguments
ifargs.count<>1thenmsgbox"db.mdb":wscript.quit
Setconn=CreateObject("ADODB.Connection")
pwd="密"&chr(13)&chr(9)&chr(10)&"码"&chr(2)
connStr="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&args(0)&";..
分类:
其他好文 时间:
2015-06-10 15:51:11
阅读次数:
1056
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */#define ...
分类:
其他好文 时间:
2015-06-10 14:08:26
阅读次数:
100
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */#define ...
分类:
其他好文 时间:
2015-06-10 14:07:08
阅读次数:
91
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2015-06-10 07:42:10
阅读次数:
99
问题描述:读入两个字符串a和b,判断a是否是b的子串。如果是,计算a在b中出现了几次。
例如:如果a="aba", b="ababab",则a在b中出现了两次。如果a="abc",b="ababab",则a不是b的子串。
代码如下:
#include
#include
using namespace std;
char a[100], b[100];
int la, lb, count;...
分类:
其他好文 时间:
2015-06-09 21:58:43
阅读次数:
96
今天做了一道leetcode题,刚开始是暴力破解,发现special judge, very large tree 过不去,然后一顿想,一顿查,发现可以运用complete binary tree 的性质,然后用的python编写,发现还是过不去,(这个版本是运用左右子数的高度去查找,如果相等那么可...
分类:
其他好文 时间:
2015-06-09 21:45:50
阅读次数:
113
众所周知,ObjectiveC的内存管理引用的一种叫做“引用计数“ (Reference Count)的操作方式,简单的理解就是系统为每一个创建出来的对象,(这里要注意,只是对象,NSObject的子类,基本类型没有‘引用计数’)记录一个引用计数,初始化这个对象的时候会调用alloc方法,系统在al...
分类:
其他好文 时间:
2015-06-09 21:37:28
阅读次数:
128
定义和用法array_count_values() 函数用于统计数组中所有值出现的次数。本函数返回一个数组,其元素的键(索引)是原数组的值,元素的值是该值在原数组中出现的次数。语法array_count_values(array)参数描述array必需。规定输入的数组。例子输出:Array ( [A...
分类:
Web程序 时间:
2015-06-09 19:33:31
阅读次数:
174