- 博客(8)
- 资源 (8)
- 收藏
- 关注
原创 求两个字符串的公共子串
求两个字符串的公共子串.... #include using namespace std; /* a b c d a b a b a 1 0 0 0 0 0 1 0 b 0 2 0 0 0 1 0 1 c 0 0 3 0 0 0 0 0 a 1 0 0 0 1 0 1 0 特征数组的值:等于左上角+1 */ typedef struct {
2013-07-31 23:52:48 738
原创 二叉树的基本操作
二叉树的基本操作如下,还会陆续补充.... #include #include #include #include using namespace std; typedef struct _BTNode //树节点 { char data; struct _BTNode *lchild,*rchild; }BTNode; typedef struct combine_nod
2013-07-30 23:33:21 691
原创 面试题--两有序数组合并
两个数组,长度不确定,但是两个数组有序,怎么让你合成一个有序的数组? #include using namespace std; int* sort_array(const int* array1,const int* array2,int len1,int len2) { int *array3=new int[len1+len2]; memset(array3,0,len1+le
2013-07-28 22:48:49 574
原创 括号匹配(二)
描述 给你一个字符串,里面只包含"(",")","[","]"四种符号,请问你需要至少添加多少个括号才能使这些括号匹配起来。 如: []是匹配的 ([])[]是匹配的 ((]是不匹配的 ([)]是不匹配的 输入第一行输入一个正整数N,表示测试数据组数(N 每组测试数据都只有一行,是一个字符串S,S中只包含以上所说的四种字符,S的长度不超过100输出对于每组测试数据都输出一个正整数,表
2013-07-28 17:20:41 461
原创 水仙花数
描述 请判断一个数是不是水仙花数。 其中水仙花数定义各个位数立方和等于它本身的三位数。 输入有多组测试数据,每组测试数据以包含一个整数n(100 输入0表示程序输入结束。输出如果n是水仙花数就输出Yes 否则输出No #include #include using namespace std; void judge(int data) { vector myvector; i
2013-07-27 13:01:25 476
原创 Binary String Matching
描述 Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a substring of B? For example, the text string B is ‘1001110110’ while
2013-07-27 11:52:46 574
原创 ASCII码排序
描述 输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符。 输入第一行输入一个数N,表示有N组测试数据。后面的N行输入多组数据,每组输入数据都是占一行,有三个字符组成,之间无空格。输出 对于每组输入数据,输出一行,字符中间用一个空格分开。 #include using namespace std; void show(const char *s) {
2013-07-26 18:57:26 525
原创 括号配对问题
描述 现在,有一行括号序列,请你检查这行括号是否配对。 输入第一行输入一个数N(0输出 每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,则输出Yes,如果不配对则输出No #include #include using namespace std; bool judge(const char *s,int mylength) { stack myst
2013-07-26 18:14:21 497
video_file_format_spec_v10
2018-05-07
MFC 自定义消息和自定义类
2013-07-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人