
字符串
文章平均质量分 62
「已注销」
这个作者很懒,什么都没留下…
展开
-
最长回文子串
输入一个字符串,求其最长的原创 2014-07-08 12:58:37 · 448 阅读 · 0 评论 -
周期串
本文出自:《算法竞赛rumenjingdi》转载 2014-07-08 11:21:06 · 312 阅读 · 0 评论 -
两个字符串的最长公共子串
#include "stdio.h" #include "malloc.h" #include "string.h" char *maxsubstr(char *str1, char *str2) { char *p1, *p2, *q1, *q2, *destp; char *substr; int max = 0, len原创 2014-07-10 14:03:42 · 330 阅读 · 0 评论 -
已知二叉树的先序遍历和中序遍历序列,输出后序遍历序列
#include #include const int N=20; char s1[N], s2[N], ans[N]; void build(int n, char* s1, char* s2, char* s) { if(n <= 0) return; int p = strchr(s2, s1[0]) - s2;//strchr----找到s1[0]在s2中的位置 build(p,原创 2014-07-08 22:38:14 · 7882 阅读 · 0 评论 -
字符串过滤
/*字符串过滤并按照字母顺序排列 样例输入:bbdfafedsgssg 样例输出:abdefgs 思想:对输入的字符串排序,用另一个字符串输出,判断前一个字符是否和 后一个相同,不同则输出*/ #include #include #include using namespace std; char str1[100], str2[100]; int main() { int i, len, m=原创 2014-07-10 14:33:10 · 424 阅读 · 0 评论