会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
jihite
不害怕 不着急 不要脸
博客园
新随笔
联系
订阅
管理
上一页
1
···
44
45
46
47
48
49
50
51
52
···
69
下一页
2014年3月30日
KMP算法的C++实现
摘要: 这个问题阮一峰老师讲的很清楚,链接这里我只贴一下我的C++实现代码:#include #include #include #include #include using namespace std;void BuildPatchMatchTable(int *partMatchTable, char...
阅读全文
posted @ 2014-03-30 12:13 jihite
阅读(16594)
评论(4)
推荐(1)
2014年3月29日
我也说说中文分词(上:基于字符串匹配)
摘要: 1. 序词是句子组成的基本单元,不像英语句子已经分好词了,中文处理的第一步就是中文分词。分词中面临的三大基本问题分词规范分词歧义未登录词的识别中文分词算法大概分为两大类第一类:基于字符串匹配 即扫描字符串,如果发现字符串的子串和词相同,就算匹配。这类分词通常会加入一些启发式规则,比如“正向/反向最...
阅读全文
posted @ 2014-03-29 11:02 jihite
阅读(11398)
评论(0)
推荐(2)
2014年3月24日
删除字符串中的空格
摘要: 实例替换前 abc def ghi替换后 abcdefghighi思路从前往后遍历字符串a,记录空格的个数SpaceNuma[i] = '' : SpaceNum++a[i]!='' : a[i-SpaceNum] = a[i]参考代码#include #include using namespace std;void RemoveSpace(char *a){ if(a == NULL) return; int len = strlen(a); int SpaceNum = 0; for(int i = 0; i 0) a[i -...
阅读全文
posted @ 2014-03-24 20:31 jihite
阅读(1609)
评论(0)
推荐(0)
linux jdk bin安装
摘要: 1、jdk-1_5_0_06-linux-i586.bin下载到/usr/soft,赋予可执行权限:chmod 755 jdk-1_5_0_06-linux-i586.bin2、执行:./jdk-1_5_0_06-linux-i586.bin 空格键翻页,到最后输入yes (或直接选All)3、配置环境变量:在/etc/profile 中加入:export PATH=/usr/soft/jdk1.5.0_06/bin:$PATHexport JAVA_HOME=/usr/soft/jdk1.5.0_064、运行:source /etc/profile 使配置文件生效5、运行:java -ve.
阅读全文
posted @ 2014-03-24 10:30 jihite
阅读(15693)
评论(2)
推荐(0)
2014年3月23日
笔试题汇总
摘要: 2012微软暑期实习生笔试题阿里巴巴集团2014秋季校园招聘笔试题
阅读全文
posted @ 2014-03-23 15:44 jihite
阅读(294)
评论(0)
推荐(0)
2014年3月22日
栈的压入、弹出序列
摘要: 问题判断一数字序列是否为这些数字入栈的一种出栈方式(前提:栈中的数字不重复)例如假设入栈的序列为:1 2 3 4 5那么4 5 3 2 1为一种弹出序列, 4 3 5 1 2不是思路开辟一个辅助栈,模拟入栈出战过程(假设pa为入栈序列,pb为出战序列)pa中的元素依次压入辅助栈新压入的元素与弹出序列的栈底相同,辅助栈弹出,同时pb向上移动不相同了pa中的元素继续入辅助栈参考代码#include #include using namespace std;bool IsPopOrder(const int *a, const int *b, int lena, int lenb){ if(l...
阅读全文
posted @ 2014-03-22 23:01 jihite
阅读(4229)
评论(0)
推荐(0)
顺序打印矩阵
摘要: 思路参考代码#include using namespace std;void printNumAsClockwise(int a[][4], int row, int col){ if (row = left; --i) cout = up; --i) cout using namespace std;void printNumAsClockwise(int *a, int row, int col){ if (row = left; --i) cout = up; --i) cout << ...
阅读全文
posted @ 2014-03-22 20:35 jihite
阅读(626)
评论(0)
推荐(0)
二叉树镜像
摘要: 镜像——照镜子得出的像。特征就是左右反着,如下图思路仿着递归遍历,递归得到镜像输入结点指针p不为空且部位叶子,反转p的左右孩子找p的左孩子的镜像找p的右孩子的镜像参考代码void getImage(BinaryTreeNode *root){ if(root != NULL && root->m_pLeft != NULL && root->m_pRight != NULL) { BinaryTreeNode *temp = root->m_pLeft; root->m_pLeft = root->m_pRight; root-&g
阅读全文
posted @ 2014-03-22 17:42 jihite
阅读(1139)
评论(0)
推荐(0)
树的子结构
摘要: 题目输入两颗二叉树A和B,判断B是否是A的子结构,例如下图中B是A的子结构 A B参考代码1bool IsPartTree(TreeNode *root1, TreeNode *root2){ if(root1 == NULL...
阅读全文
posted @ 2014-03-22 17:12 jihite
阅读(1185)
评论(2)
推荐(0)
2014年3月21日
典型时间复杂度求解
摘要: 1. n!int f(unsigned int n){ if(n == 0 || n == 1) return 1; else return n*f(n-1);}分析:计算N的阶乘需要进行N次乘法运算,因此时间复杂度为O(N)
阅读全文
posted @ 2014-03-21 23:59 jihite
阅读(491)
评论(0)
推荐(0)
上一页
1
···
44
45
46
47
48
49
50
51
52
···
69
下一页
公告